How to install IonCube Loader on Amazon Linux x64 instance

5.6k Views Asked by At

I'm having trouble installing IonCube Loader on my Amazon Linux x64 instance.

I'm following these instructions below but the paths are way off and I can't seem to locate the right ones on my install.

For x64:

wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz 
tar xfvz ioncube_loaders_lin_x86-64.tar.gz

Proceed as follows:

cp ioncube/ioncube_loader_lin_5.3.so /usr/lib/php5/20090626/ioncube.so

Now edit to match:

zend_extension = /usr/lib/php5/20090626/ioncube.so

nano /etc/php5/conf.d/ioncube.ini

First, there is no /usr/lib/php5/20090626/ folder. I changed these paths to /usr/lib64/php/modules and included the .so file in there.

However, I cannot seem to locate any ioncube.ini file to edit. Any help is appreciated...

Thank you!

2

There are 2 best solutions below

0
On

I followed the instructions provided here in the first answer, making allowance for the fact that I'm runnning PHP 5.6:

sudo cp ioncube_loader_lin_5.6.so /usr/lib64/php/5.6/modules/ioncube.so
echo "zend_extension=/usr/lib64/php/5.6/modules/ioncube.so" > /etc/php.d/ioncube.ini

However, when restarting Apache, I found that it started then failed immediately. The Apache log gave me this error:

PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0

I changed the name of the file from ioncube.so to 00-ioncube.so and restarted Apache. This solved the problem by making this file load before the other modules.

3
On

For future readers sake, there is a difference between Amazon's Linux and other versions that most articles online refer to.

You can follow the first two steps above to get the installer, I like to use a temporary folder. Do this as root:

sudo -i
cd /tmp
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz 
tar xfvz ioncube_loaders_lin_x86-64.tar.gz

Copy the required extension to a slightly different folder under EC2 linux instances, and the loader wizard to your webroot:

cp ioncube/ioncube_loader_lin_5.4.so /usr/lib64/php/modules/ioncube.so

Create your ini file:

echo "zend_extension=/usr/lib64/php/modules/ioncube.so" > /etc/php.d/ioncube.ini

Reload Apache (if you're using it):

service httpd restart

I'm using NGINX and PHP-FPM, in this case you'd probably want to restart PHP-FPM as well as NGINX.

Lastly, use the loader wizard to test it by navigating to http://example.com/loader-wizard.php, and delete the temp files and loader wizard when finished:

rm -rf /tmp/ioncube*
rm /var/www/html/loader-wizard.php