You could do this manually inside the web container each time you did a ddev start
, but that doesn't sound like much fun.
Instead, we'll incorporate all the required changes into the add-on Dockerfile see docs.
Put these contents in your project's .ddev/web-build/Dockerfile and then it will (one time) build up your ddev-webserver image with the ioncube .so loader you need and the PHP configuration you need. This is for PHP 7.1 as you said, you'd change the PHP_VERSION for some other version.
ARG BASE_IMAGE
FROM $BASE_IMAGE
# Install the ioncube loader - set the PHP_VERSION to what you need
ENV PHP_VERSION=7.1
RUN mkdir -p /usr/local/lib && curl -sSlL -o /tmp/ioncube.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && tar -x --strip-components=1 -C /usr/local/lib -f /tmp/ioncube.tar.gz ioncube/ioncube_loader_lin_${PHP_VERSION}.so
# The ioncube_loader has to be the very first thing in the php.ini, so insert it there.
ENV PHP_INI_PATH=/etc/php/${PHP_VERSION}/fpm/php.ini
RUN (echo 'zend_extension = /usr/local/lib/ioncube_loader_lin_${PHP_VERSION}.so' && cat ${PHP_INI_PATH}) > ${PHP_INI_PATH}.new && mv ${PHP_INI_PATH}.new ${PHP_INI_PATH}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…