How to Install ionCube Loader on Debian 9

In this article, we will show you how to install ionCube loader on a Debian 9 server. ionCube PHP encoder is the most popular PHP solution for licensing and encoding PHP files and encrypting any other file types. When using ionCube, PHP scripts are first compiled and then optimized. This prevents others from copying your source code and increases the website loading speed. ionCube loader is a PHP extension that is used to execute the encoded PHP files, encrypt or decrypt non-PHP files and validate licenses.

This guide should work on other Linux VPS systems as well, but was tested and written for Debian 9 VPS.

Download ionCube Loader

The Ioncube loader archive can be downloaded free of charge from the official website.

To download the latest ionCube loaders archive file run the following wget command:

wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Once the file is downloaded, run the following tar command to extract the file in the current working directory:

tar -xf ioncube_loaders_lin_x86-64.tar.gz

You can now change to the ioncube directory with:

cd ioncube

and use the ls command to list all extracted files:

ls -1 

The output should look like this:

LICENSE.txt
README.txt
USER-GUIDE.pdf
USER-GUIDE.txt
ioncube_loader_lin_4.1.so
ioncube_loader_lin_4.2.so
ioncube_loader_lin_4.3.so
ioncube_loader_lin_4.3_ts.so
ioncube_loader_lin_4.4.so
ioncube_loader_lin_4.4_ts.so
ioncube_loader_lin_5.0.so
ioncube_loader_lin_5.0_ts.so
ioncube_loader_lin_5.1.so
ioncube_loader_lin_5.1_ts.so
ioncube_loader_lin_5.2.so
ioncube_loader_lin_5.2_ts.so
ioncube_loader_lin_5.3.so
ioncube_loader_lin_5.3_ts.so
ioncube_loader_lin_5.4.so
ioncube_loader_lin_5.4_ts.so
ioncube_loader_lin_5.5.so
ioncube_loader_lin_5.5_ts.so
ioncube_loader_lin_5.6.so
ioncube_loader_lin_5.6_ts.so
ioncube_loader_lin_7.0.so
ioncube_loader_lin_7.0_ts.so
ioncube_loader_lin_7.1.so
ioncube_loader_lin_7.1_ts.so
ioncube_loader_lin_7.2.so
ioncube_loader_lin_7.2_ts.so
loader-wizard.php

As you can see each ionCube loader file ends with PHP_VERSION.so which corresponds to a specific PHP version. For example ioncube_loader_lin_7.1.so is the PHP extension file that you need to enable if you run PHP 7.1 version on your server.

Install IonCube Loader

The default PHP version in Debian 9 is PHP version 7.0. You can check the PHP version installed on your server by running:

php -v

The output should look like this:

PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

Next, find the location of the PHP extension directory with the following command:

php -i | grep extension_dir

The output should look like this:

extension_dir => /usr/lib/php/20151012 => /usr/lib/php/20151012

In our case the location of the PHP extension directory is /usr/lib/php/20151012.

Once you know the location of the PHP extension directory copy the corresponding ionCube loader file into it with the following command:

sudo cp ioncube_loader_lin_7.0.so /usr/lib/php/20151012/

If you have another non-default version of PHP installed on your server you need to copy the corresponding ioncube loader file. For example if you have PHP version 5.6 you will need to copy the ioncube_loader_lin_5.6.so file.

Now you need to open the PHP CLI php.ini file and add the following line that will load the ionCube extension.

sudo vim /etc/php/7.0/cli/php.ini

Append the following line at the end of the file:

sudo zend_extension=/usr/lib/php/20151012/ioncube_loader_lin_7.0.so

Install IonCube Loader for Apache Mod PHP

If you are using apache with mod_php to enable ionCube loader extension open the following file:

sudo vim /etc/php/7.0/apache2/php.ini

Append the following line at the end of the file:

zend_extension=/usr/lib/php/20151012/ioncube_loader_lin_7.0.so

Save the file and restart the Apache service to apply the changes:

sudo vim systemctl restart apache2

Install IonCube Loader for PHP-FPM

If you are using Apache or Nginx with PHP-FPM as the PHP processor, open the following file and add the same line:

sudo sudo nano /etc/php/7.0/fpm/php.ini

Append the following line at the end of the file:

zend_extension=/usr/lib/php/20151012/ioncube_loader_lin_7.0.so

Save the file and restart the PHP-FPM service for changes to take effect:

sudo sudo systemctl restart php7.0-fpm

Testing ionCube Loader

To test if the ionCube loader is successfully installed run the following command:

php -v

The output should contain a line saying that the ionCube PHP Loader is enabled. Also you will be able to see the ionCube PHP Loader version, which at the time of writing of this post is v10.2.4.

PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd.
    with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

Install ionCube Loader on Debian 9Of course, you don’t have to know how to install ionCube Loader on Debian 9 if you have a VPS Hosting with us. You can simply ask our administrators to install the ionCube PHP Loader on your server. They’re available 24/7, and will be able to help you with the installation of ionCube Loader on Debian 9.

PS. If you enjoy reading this blog post on How to Install ionCube Loader on Debian 9, feel free to share it on social networks using the shortcuts below, or simply leave a comment.