Install Ioncube Loaders for PHP 7.0

If you’ve upgraded to PHP 7.0 recently and need the Ioncube Loaders for PHP 7.o here’s a basic tutorial to help you install them.

First of all you’ll have to identify the loaders you need and pull the download link from the Ioncube Downloads page. This tutorial is based on Debian Jessie with PHP 7.0 and PHP-FPM on an 64bit system with Apache2, but you can easily adapt it to other operating systems and setups.

The first step to take once you’ve identified the loaders you need and copied the link to them is to download the archive containing the loaders to a temporary location either logged in as root or using sudo:

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

(replace the link with your own if you require different loaders)

Next you’ll need to extract the loaders from the archive:

tar zxvf ioncube_loaders_lin_x86-64.tar.gz

This will create a directory called ioncube, which needs to be moved to a permanent location:

cp -a ioncube /usr/local

We’re using the cp command with the -a attribute simply because you may already have older loaders within the /usr/local/ioncube directory and we want to overwrite those with the newly downloaded.

Once the files are in place we need to make sure they are loaded too and since we need the loader for PHP 7.0 only we’ll add it to the php.ini files using the following command string:

for i in {apache2,cgi,cli,fpm}; do echo “zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.0.so” >> /etc/php/7.0/$i/php.ini; done

We’re using the command string to append the line to every single php.ini file and avoid manually editing them. But if you’re oldschool and have time on your hands then you can go ahead and edit the files by hand.

Also if you’re not using PHP-FPM just remove “fpm” from the list of directories in the command string.

The next and last step would be to simply restart the daemons with the new config which inherits the new PHP loader:

service apache2 restart && service php7.0-fpm restart

Alternatively if you’re not using PHP-FPM restarting Apache2 will do:

service apache2 restart

P.S. If you were uber bored and installed Nginx as a reverse proxy you will have to restart Nginx too.

That’s all folks. Hope it helps.

Post A Comment

Your email address will not be published. Required fields are marked *