Steven Willett
Steven Willett

Reputation: 41

Docker, Alpine, IonCube, PHP7 FPM

I'm attempting to Dockerize a PHP application that uses IonCube encryption.

The application, stand alone with IonCube runs fine, when i try to Dockerize this with a lean image (Docker, Alpine, PHP7.0) its only failing around the IonCube install.

Steps taken:

  1. Followed the displayed IonCube instructions to install.
  2. After attempted install, navigated to directories within the Docker image to confirm COPY has executed correctly and all related files show in the image by using "docker exec -it image_name /bin/sh".
  3. Although the files show as per above command and after checking the image, a message in Powershell shows: "Failed loading /usr/lib/php7/modules/ioncube_loader_lin_7.0.so: Error relocating /usr/lib/php7/modules/ioncube_loader_lin_7.0.so: __strtod_internal: symbol not found".
  4. Again accessed the docker image "docker exec -it image_name /bin/sh" and the files show. But it appears to be unable to load the .SO file.
  5. Initially thought maybe its a directory permissions issue, but still no luck when i chmod the dir to 777.

Has anyone hit this problem in the past?

Dockerfile contents:

FROM richarvey/nginx-php-fpm:php7
COPY web /www
RUN chmod -R 777 /usr/lib/php7/modules
COPY web/ioncube/linux-64 /usr/lib/php7/modules
COPY web/ioncube/linux-64-ini /etc/php7/conf.d
WORKDIR /www

IonCube loader-wizard.php Instructions:

  1. Download one of the following archives of Loaders for Linux x86-64:
    • tar.gz
    • tar.bz2
  2. Put the Loader files in /usr/lib/php7/modules
  3. Edit the file /etc/php7/conf.d/00_ioncube.ini and before any other zend_extension lines ensure that the following is included: zend_extension = /usr/lib/php7/modules/ioncube_loader_lin_7.0.so
  4. Restart the server software.

Still after executing the above, checking that the respective files exist in the respective directory within Alpine, I then, destroy the docker image, build, and then run it, but no Joy. I then also tried just restarting the docker image instead of "docker rm image_name" in case it was destroying the installed IonCube related changes, but again still no luck.

I'm at a bit of a loss.

Any pointers or guidance appreciated.

Upvotes: 1

Views: 3295

Answers (1)

Steven Willett
Steven Willett

Reputation: 41

The root of the issue is because IonCube requires glibc (GNU C Library). IonCube have mentioned in a tweet to me that this is something they will be looking to resolve in the future. (No timeline given)

References: https://en.wikipedia.org/wiki/GNU_C_Library

Upvotes: 3

Related Questions