6.6 Installing IonCube Loader

IonCube Loader is a PHP interpreter extension that is used to load and execute encrypted PHP files. It is used to protect your PHP code from unauthorized access and copying. IonCube is a common requirement for operation or optimization of many CMSs or their plugins.

On our shared hosting, support for IonCube and its version depends on the version of PHP selected for the user. This is true for any line of hosting tariff plans, as well as for virtual/dedicated servers with the ISPManager4 panel installed.

Attention: if the ISPManager4 panel is installed on your server, you already have IonCube installed for all supported versions. You should under no circumstances perform this instruction, as this may lead to complete server inoperability. If there is a need to update the version of IonCube, please contact our Support service.

Prerequisites for installing IonCube

If you have a server without any control panel, you may be faced with the need to manually install IonCube.

The installation process differs depending on your OS. Regardless of the OS, the first step is always to connect via SSH and obtain root access.

Installing IonCube requires a machine with an active and running web server, Apache or Nginx, and a PHP version installed from the IonCubeLoader supported list.

Attention: IonCube Loader has a certain peculiarity - it often does not support “zero” versions of PHP, for example PHP 8.0. At the same time, versions of PHP 8.1 or PHP 8.2 are supported by it.

Step-by-step IonCube installation guide

Important: The meaning of the commands used when installing IonCube Loader varies depending on several variables: the version of PHP on the server, the location of the PHP directory and the version of the server architecture. Here and further we will highlight the values of these variables. Instead, during installation, you will need to substitute the appropriate values for your server.

1. Connect to the server via SSH.

2. Check the architecture of the current server:

  1. uname -m
Output
x86_64

As we can see from x86_64, our current server runs on 64-bit architecture. Values like i686 would indicate the opposite – 32-bit architecture of your server.

3. Next, go to the tmp directory and download the required archive:

  • For 64-bit systems:
  1. cd /tmp
  2. wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
  • For 32-bit systems:
  1. cd /tmp
  2. wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

4. After downloading the archive, you need to unzip it:

Since in the example we use 64-bit architecture, we downloaded and unpacked just such an archive.

  1. tar -zxvf ioncube_loaders_lin_x86-64.tar.gz

.5. Go to the ioncube directory and look through the list of files.

  1. cd ioncube/
  2. ls -l
Output
total 39260 -rw-rw-r-- 1 507 507 472192 Sep 9 2023 ioncube_loader_lin_4.1.so -rw-rw-r-- 1 507 507 471968 Sep 9 2023 ioncube_loader_lin_4.2.so -rw-rw-r-- 1 507 507 472768 Sep 9 2023 ioncube_loader_lin_4.3.so -rw-rw-r-- 1 507 507 490752 Sep 9 2023 ioncube_loader_lin_4.3_ts.so -rw-rw-r-- 1 507 507 475840 Sep 9 2023 ioncube_loader_lin_4.4.so -rw-rw-r-- 1 507 507 494880 Sep 9 2023 ioncube_loader_lin_4.4_ts.so -rw-rw-r-- 1 507 507 483360 Sep 9 2023 ioncube_loader_lin_5.0.so -rw-rw-r-- 1 507 507 497632 Sep 9 2023 ioncube_loader_lin_5.0_ts.so -rw-rw-r-- 1 507 507 1116768 Sep 9 2023 ioncube_loader_lin_5.1.so -rw-rw-r-- 1 507 507 1155744 Sep 9 2023 ioncube_loader_lin_5.1_ts.so -rw-rw-r-- 1 507 507 1139936 Sep 9 2023 ioncube_loader_lin_5.2.so -rw-rw-r-- 1 507 507 1176704 Sep 9 2023 ioncube_loader_lin_5.2_ts.so -rw-rw-r-- 1 507 507 1222328 Sep 9 2023 ioncube_loader_lin_5.3.so -rw-rw-r-- 1 507 507 1275512 Sep 9 2023 ioncube_loader_lin_5.3_ts.so -rw-rw-r-- 1 507 507 1512960 Sep 9 2023 ioncube_loader_lin_5.4.so -rw-rw-r-- 1 507 507 1599584 Sep 9 2023 ioncube_loader_lin_5.4_ts.so -rw-rw-r-- 1 507 507 1520056 Sep 9 2023 ioncube_loader_lin_5.5.so -rw-rw-r-- 1 507 507 1602040 Sep 9 2023 ioncube_loader_lin_5.5_ts.so -rw-rw-r-- 1 507 507 1485192 Sep 9 2023 ioncube_loader_lin_5.6.so -rw-rw-r-- 1 507 507 1549640 Sep 9 2023 ioncube_loader_lin_5.6_ts.so -rw-rw-r-- 1 507 507 1254608 Sep 9 2023 ioncube_loader_lin_7.0.so -rw-rw-r-- 1 507 507 1316080 Sep 9 2023 ioncube_loader_lin_7.0_ts.so -rw-rw-r-- 1 507 507 1355080 Sep 9 2023 ioncube_loader_lin_7.1.so -rw-rw-r-- 1 507 507 1438760 Sep 9 2023 ioncube_loader_lin_7.1_ts.so -rw-rw-r-- 1 507 507 1407568 Sep 9 2023 ioncube_loader_lin_7.2.so -rw-rw-r-- 1 507 507 1489008 Sep 9 2023 ioncube_loader_lin_7.2_ts.so -rw-rw-r-- 1 507 507 1316800 Sep 9 2023 ioncube_loader_lin_7.3.so -rw-rw-r-- 1 507 507 1386880 Sep 9 2023 ioncube_loader_lin_7.3_ts.so -rw-rw-r-- 1 507 507 1363392 Sep 9 2023 ioncube_loader_lin_7.4.so -rw-rw-r-- 1 507 507 1430848 Sep 9 2023 ioncube_loader_lin_7.4_ts.so -rw-rw-r-- 1 507 507 1401736 Sep 9 2023 ioncube_loader_lin_8.1.so -rw-rw-r-- 1 507 507 1506216 Sep 9 2023 ioncube_loader_lin_8.1_ts.so -rw-rw-r-- 1 507 507 1439016 Sep 9 2023 ioncube_loader_lin_8.2.so -rw-rw-r-- 1 507 507 1546568 Sep 9 2023 ioncube_loader_lin_8.2_ts.so -rw-r--r-- 1 507 507 10768 Aug 5 2022 LICENSE.txt -rw-r--r-- 1 507 507 181104 Aug 15 2022 loader-wizard.php -rw-r--r-- 1 507 507 4070 Sep 9 2023 README.txt -rw-r--r-- 1 507 507 39548 Sep 9 2023 USER-GUIDE.pdf -rw-r--r-- 1 507 507 11269 Sep 9 2023 USER-GUIDE.txt

As you can see, the archive contained many different versions of the module for different versions of PHP. We need to find out which of these files we need for further installation.

6. View the current PHP version:

  1. php -v
Output
PHP 8.1.2-1ubuntu2.17 (cli) (built: May 1 2024 10:10:07) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2-1ubuntu2.17, Copyright (c), by Zend Technologies

7. The next step is to determine the directory location in which IonCube Loader will need to be installed.

  1. php -i | grep extension_dir
Output
extension_dir => /usr/lib/php/20210902 => /usr/lib/php/20210902

We will need the location /usr/lib/php/20210902 in the further installation process. In an OS from the Centos branch, such a folder may look like /usr/lib64/php/modules.

8. Copy the IonCube files to the desired directory.

  1. sudo cp /tmp/ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20210902

9. Now you need to make changes to the php.ini configuration files. Their location may vary in different server configurations:

  1. sudo nano /etc/php/8.1/cli/php.ini #for PHP CLI
  2. sudo nano /etc/php/8.1/fpm/php.ini #for PHP-FPM & Nginx
  3. sudo nano /etc/php/8.1/apache2/php.ini #for Apache2

Insert the following line at the very beginning of php.ini:

zend_extension = /usr/lib/php/20210902/ioncube_loader_lin_8.1.so

8. Restart the webserver:

Apache Ubuntu/Debian
  1. sudo systemctl restart apache2
Apache Centos/Rocky/Alma
  1. sudo systemctl restart httpd
  1. [secondary Nginx/PHP-FPM]
  2. sudo systemctl restart nginx
  3. sudo systemctl restart php-fpm

9. Check that the installation is correct with the command:

  1. php -v

If the installation is successful, a line with information about the current version of IonCube will be displayed as follows:

Output
PHP 8.1.2-1ubuntu2.17 (cli) (built: May 1 2024 10:10:07) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with the ionCube PHP Loader v13.0.2, Copyright (c) 2002-2023, by ionCube Ltd. with Zend OPcache v8.1.2-1ubuntu2.17, Copyright (c), by Zend Technologies