Install ionCube Loader on a CentOS 7 VPS

ionCube loader is a PHP module that enables PHP to load files, protected with the ionCube Encoder software. It is mostly used by many commercial software vendors to protect their code and stop it from being visible. In this tutorial we will show you how to enable ionCube Loaders on a CentOS 7 VPS.

Log in to your CentOS 7 VPS via SSH as user root

# ssh root@IP_Address

and update all installed services

# yum update

Run the ‘arch’ command in the terminal to check if your system is 32-bit (i686) or 64-bit (x86_64)

# arch

In our case the system is 64-bit and we will download the 64-bit version of ionCube Loader

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

If your system is 32-bit download the following archive

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

Once it is downloaded, unpack the tar archive

# tar xfz ioncube_loaders_lin_x86-64.tar.gz

The ionCube Loaders for all PHP versions will be extracted in a new ‘ioncube’ directory.

We need to know the PHP version installed on the server. We can find out using the following command

# php -v
PHP 5.4.16 (cli) (built: Aug 11 2016 21:24:59)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

We have PHP version 5.4.16 installed on our test server, so we will need the matching ionCube loader.

List the content of the ‘ioncube’ directory to find the necessary file

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

We will use the ‘ioncube_loader_lin_5.4.so’ file because it matches our PHP version. If you have a different version of PHP installed on your server you will have to use the appropriate file.

To find out the location of the extension directory, run the following command

# php -i | grep extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
sqlite3.extension_dir => no value => no value

Copy the ‘ioncube_loader_lin_5.4.so’ ionCube loader to the extension directory marked with red color.

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

Now, open the PHP configuration file and add the following line

# vi /etc/php.ini
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.4.so

Please note that the path of the PHP configuration file may be different on your server. You can execute ‘php –ini’ to find the loaded PHP configuration file.

# php --ini |grep "Loaded Configuration File"
Loaded Configuration File:         /etc/php.ini

Save the configuration file and restart the Apache web server for the changes to take effect.

# systemctl restart httpd

You can check if ionCube Loader is successfully enabled using the following command

# php -v
PHP 5.4.16 (cli) (built: Aug 11 2016 21:24:59)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.1.2, Copyright (c) 2002-2016, by ionCube Ltd.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to enable ionCube Loaders on your server for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Categories: Tutorials
Tags: , ,