How to Install Ioncube loader on CentOS?

How to Install Ioncube loader on CentOS?
To use ioncube encoded files we need to install Ioncube loader on the web server. Add the module definition in php configuration file will enable PHP to use it.

Lets Download it:
1. Check your system Architecture.
uname -i
2. Our system is a x86_64 Architecture, Hence we will download the 64 bit version in the /tmp.
[root@reportingServer tmp]# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
--2018-09-07 17:17:08--  http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
Resolving downloads3.ioncube.com (downloads3.ioncube.com)... 52.216.128.42
Connecting to downloads3.ioncube.com (downloads3.ioncube.com)|52.216.128.42|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11201964 (11M) [application/x-tar]
Saving to: ‘ioncube_loaders_lin_x86-64.tar.gz’

100%[================================================================================================================================

2018-09-07 17:17:12 (2.90 MB/s) - ‘ioncube_loaders_lin_x86-64.tar.gz’ saved [11201964/11201964]
3. Now untar the bundle.
[root@reportingServer tmp]# tar xfz ioncube_loaders_lin_x86-64.tar.gz
4. There will be multiple files in the unzipped folder. Now Select the appropriate ioncube files according to your installed PHP version. To know your PHP version please run this Command.
root@reportingServer tmp]# php -v
PHP 5.4.16 (cli) (built: Jun 10 2015 04:34:17)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@reportingServer tmp]#

[root@reportingServer tmp]# ls /tmp/ioncube
ioncube_loader_lin_4.1.so     ioncube_loader_lin_5.0.so     ioncube_loader_lin_5.3.so     ioncube_loader_lin_5.6.so     ioncube_loade
ioncube_loader_lin_4.2.so     ioncube_loader_lin_5.0_ts.so  ioncube_loader_lin_5.3_ts.so  ioncube_loader_lin_5.6_ts.so  ioncube_loade
ioncube_loader_lin_4.3.so     ioncube_loader_lin_5.1.so     ioncube_loader_lin_5.4.so     ioncube_loader_lin_7.0.so     LICENSE.txt
ioncube_loader_lin_4.3_ts.so  ioncube_loader_lin_5.1_ts.so  ioncube_loader_lin_5.4_ts.so  ioncube_loader_lin_7.0_ts.so  loader-wizard
ioncube_loader_lin_4.4.so     ioncube_loader_lin_5.2.so     ioncube_loader_lin_5.5.so     ioncube_loader_lin_7.1.so     README.txt
ioncube_loader_lin_4.4_ts.so  ioncube_loader_lin_5.2_ts.so  ioncube_loader_lin_5.5_ts.so  ioncube_loader_lin_7.1_ts.so  USER-GUIDE.pd
[root@reportingServer tmp]#
5. We need to find the extension_dir for the PHP. To do this please run this command.
[root@reportingServer tmp]# php -i | grep extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
[root@reportingServer tmp]#
6. Now copy the ioncube loader file to the extension directory. In our case it is 5.4 file.
[root@reportingServer tmp]# cp -pr /tmp/ioncube/ioncube_loader_lin_5.4.so /usr/lib64/php/modules/
7. Now add following line in the top of /etc/php.ini file under PHP section.
[root@reportingServer tmp]# vi /etc/php.ini
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.4.so
8. Now restart the Apache web server for the changes to come into effect.
[root@reportingServer tmp]# service httpd restart
Redirecting to /bin/systemctl restart  httpd.service
[root@reportingServer tmp]# service httpd status
Redirecting to /bin/systemctl status  httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2018-09-07 17:24:01 CEST; 4s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 17734 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 28083 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 17762 (httpd)
   Status: "Processing requests..."
   CGroup: /system.slice/httpd.service
           ├─17762 /usr/sbin/httpd -DFOREGROUND
           ├─17768 /usr/sbin/httpd -DFOREGROUND
           ├─17769 /usr/sbin/httpd -DFOREGROUND
           ├─17770 /usr/sbin/httpd -DFOREGROUND
           ├─17771 /usr/sbin/httpd -DFOREGROUND
           └─17772 /usr/sbin/httpd -DFOREGROUND

Sep 07 17:24:01 reportingServer systemd[1]: Starting The Apache HTTP Server...

Test:
We need to  test if the ioncube loader has come into effect or not.
[root@reportingServer tmp]# php -v
PHP 5.4.16 (cli) (built: Jun 10 2015 04:34:17)
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) v10.2.4, Copyright (c) 2002-2018,
[root@reportingServer tmp]#

0 Comments