Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
555 views
in Technique[技术] by (71.8m points)

php - How can I install the ioncube loader in the DDEV-Local web container?

I'm using DDEV to develop an OXID Esales Project. It's very comfortable to work with but now I have to install the Ioncube Loader. How can I do that? I have to put the .so file into the php direction inside the container and extend the php.ini. But I don't know how? Can someone help me?

Project: OXID E-Sales

  • php7.1
  • mysql5.7
  • MacOS
  • DDEV
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...