Skip to content

Instantly share code, notes, and snippets.

@cloudmaker97
Last active April 2, 2024 23:38
Show Gist options
  • Save cloudmaker97/e6463478134c1d38cf693ce27d7f25e6 to your computer and use it in GitHub Desktop.
Save cloudmaker97/e6463478134c1d38cf693ce27d7f25e6 to your computer and use it in GitHub Desktop.
ionCube Loader for DDEV

ionCube Loader for DDEV (Encryption)

I had a project where dependencies (encrypted with ionCube) were used by my further maintainers. I didn't found any working solution for adding the ionCube Loader, so i decided to create a custom Dockerfile which runs when DDEV start. I hope you will have less trouble than me by using this just by following the instructions. 😀

Instructions

  1. Open the .ddev/web-build/ folder
  2. Download the current ionCube Loader here: https://downloads.ioncube.com
  3. Extract the archive into this folder .ddev/web-build/ioncube, so all *.so files are in the root of the directory
  4. Create a file named .ddev/web-build/Dockerfile and choose a file below this text file (different PHP Versions)
  5. Don't forget to check if the PHP version setting php_version is set in the .ddev/config.yaml correct
  6. Run the command ddev restart to start using the DDEV Service with the ionCube PHP extension.

Provided Versions

This gist covers this (most common) PHP versions:

  • 8.1 (/usr/lib/php/20210902)
  • 7.3 (/usr/lib/php/20180731)
  • 5.6 (/usr/lib/php/20131226)

Troubleshooting

If the start from DDEV fails, run the command ddev logs and check the reasons for the shutdown.

# ionCube Loader (for PHP 5.6)
ADD ./ioncube/ioncube_loader_lin_5.6.so /usr/lib/php/20131226
RUN echo "zend_extension=/usr/lib/php/20131226/ioncube_loader_lin_5.6.so" > /etc/php/5.6/fpm/php.ini
# ionCube Loader (for PHP 7.3)
ADD ./ioncube/ioncube_loader_lin_7.3.so /usr/lib/php/20180731
RUN echo "zend_extension=/usr/lib/php/20180731/ioncube_loader_lin_7.3.so" > /etc/php/7.3/fpm/php.ini
# ionCube Loader (for PHP 8.1)
ADD ./ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20210902
RUN echo "zend_extension=/usr/lib/php/20210902/ioncube_loader_lin_8.1.so" > /etc/php/8.1/fpm/php.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment