There is a new version of this tutorial available for Debian 11 (Bullseye).

How to Install ionCube Loader on Debian 9

This tutorial exists for these OS versions

On this page

  1. Requirements
  2. Getting Started
  3. Installing IonCube Loader
  4. Testing IonCube Loader

IonCube is a PHP extension that can be used for decoding secured encrypted PHP files at runtime. The IonCube encoder is used by commercial PHP program vendors to protect applications and the loader, which we install in this tutorial, is required to run IonCube encoded files on your server. The IoncubeLoader is available free of charge. Ioncube loader increases your website loading speed and preventing others from stealing the source code by converting your PHP into byte-code.

In this tutorial, we will explain the installation of IonCube Loader on Debian 9 server.

Requirements

  • A server running Debian 9 with LAMP installed.
  • A non-root user with sudo privileges.

Getting Started

Before starting, update all packages that are installed on your server using the following command:

sudo apt-get update -y
sudo apt-get upgrade -y

Once all the packages are updated, restart the system to apply all the changes:

sudo reboot

Installing IonCube Loader

First, you will need to download the latest version of the IonCube Loader from their official website. Otherwise, you can download it using the following command:

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

Once the download is completed, extract the downloaded file using the following command:

tar -xvzf ioncube_loaders_lin_x86-64.tar.gz

By default the files will be unzipped to a folder ioncube.

Now, change the directory to ioncube folder and run ls command to see all the extension:

cd ioncube
ls

You should see the various ioncube loader files corresponding to various php versions as below:

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

Now, you will need to select the correct ioncube loader file as per the PHP version installed on your server. Run the following command to see the version of PHP installed on your server:

php -v

Output:

PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

In the above output, you should see that the PHP version installed is PHP 7.0.22. So you will need to copy ioncube_loader_lin_7.0.so file from ioncube directory to the PHP extension directory.

First, find the location of the PHP extension directory using the following command:

php -i | grep extension_dir

You should see the following output:

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

Now, copy ioncube loader file to the PHP extension directory (/usr/lib/php/20151012) using the following command:

cd ioncube
cp ioncube_loader_lin_7.0.so /usr/lib/php/20151012/

Next, you will need to edit php.ini file and add path of the ioncube extension. You can do this with the following command:

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

Add the following line:

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

Save the file, then open other php.ini file:

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

Add the following line:

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

Save and close the file, then restart Apache service to apply the changes:

sudo systemctl restart apache2

Testing IonCube Loader

Now, everything is configured properly, it's time to test whether Ioncube loader is installed or not. You can test it using the following command:

php -v

If everythig is fine, you should see the following output:

PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( 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.1.0, Copyright (c) 2002-2017, by ionCube Ltd.
    with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
Share this page:

7 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Mapan Web Indonesia

<quote>

Now, copy ioncube loader file to the PHP extension directory (/usr/lib/php/20151012) using the following command:

cd ioncube

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

</quote>

The command "cd ioncube" is not needed anymore since you have done it before:

<quote>

Now, change the directory to ioncube folder and run ls command to see all the extension:

cd ioncube

ls

</quote>

By: Maneesh

Hi, Thanks for this great tutorial.I have got the final output as shown here but when I try to install the script that requires ioncube loader, it throws an error that iconcube loader is disabled! Please advice...

By: jens

Same for me :( ISPconfig tells "Site error: the ionCube PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking. Please visit get-loader.ioncube.com for install assistance." 

I noticed in phpinfo() that "Loaded Configuration File" points to /etc/php5/cgi/ and I changed this php5-misslinking to /etc/php/7.3/cgi/ in the file: /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter and restart apache2

The Site error disappeared but the Interface in Web, Mail, System, .. didn't come back to life. 

Any Tipps or Ideas? Trying next night a reboot..

Thx

By: till

ISPConfig is not ioncube encoded and the file /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter is not used for any websites hosted on your server, it is used exclusively for the non-ioncube encoded software that runs on port 8080, so adding ioncube there makes no sense and changing the config include path to a wrong PHP version must crash your system. To fix your problem, undo the changes that you made in /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter

 

Back to your original problem, to enable ioncube in the website which runs ioncube encoded files, check out which php.ini is used on that site by using phpinfo() function and then add ioncube in that php.ini file, that's all.

 

The tutorial above adds ioncube loader for the PHP that ships with Debian, when you claim that you have php 7.3 installed, then that is definitely not the PHP from Debian as Debian 9 does not ship with PHP 7.3, it ships witrh PHP 7.0. So if you use a third party PHP 7.3 version and installed it in a different path, then you must  edit the php.ini file of that third party PHP version and enable ioncube there and not in the default PHP from Debian.

By: till

Then you must have installed ioncube loader in a wrong php.ini which is not used by your script. use phpinfo() command in PHP in your website to find out which php.ini file is used by your website and then enable ioncube there.

By: Nicolas

Bonjour quand je fait php -v il dit : Failed loading /usr/lib/php/20180731/ioncube_loader_lin_7.3.so:  /usr/lib/php/20180731/ioncube_loader_lin_7.3.so: wrong ELF class: ELFCLASS64

 

By: till

This means you are using a wrong binary type. Either your system runs a 32Bit kernel or your system is not an intel based processor, like a raspberry pi. In that case, download the right loaders for your processor platform.