How to Install ionCube Loader on a CentOS 7

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

# ssh root@IP_Address

and update all installed services

# yum update

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

# arch
x86_64

3. 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

4. If your system is 32-bit download the following archive

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

5. 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.

6. 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

7. Match PHP Version

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

8. Verify ionCube Loader installation

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.