How to set up IonCube on a Ubuntu LEMP

May 18, 2015 1.5k views
LEMP Ubuntu

Can someone please help advise on this. Thank you!

2 Answers

To install IonCube, you first need to download and extract the files:

  • wget
  • tar xvfz ioncube_loaders_lin_x86-64.tar.gz

Next you will need to copy the files into your PHP extension directory. This will be different on different distros and with different PHP versions. So to find it, run:

  • php -i | grep extension_dir

The output will be similar to:

extension_dir => /usr/lib/php5/20121212 => /usr/lib/php5/20121212

Now copy the IonCube file matching your PHP version to that directory. You can do so with:

  • sudo cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" /usr/lib/php5/20121212/

Then, in order for FPM to correctly find the extension, create a file named /etc/php5/fpm/conf.d/00-ioncube.ini with the contents:

zend_extension = /usr/lib/php5/20121212/

Finally, restart PHP-FPM using service php5-fpm restart

Have another answer? Share your knowledge.