How to install ioncube on jump server?
How to install Ioncube on jumpserver or bastion host?
Synopsis: IonCube Loader is typically installed to enable PHP scripts encoded with IonCube to run on a server. These scripts are often proprietary or contain sensitive intellectual property and are encoded to protect them from unauthorized access or modification. By installing IonCube Loader, the server can interpret and execute these encoded scripts, allowing them to function as intended while maintaining their security measures.
Step 1: Download the latest Ioncube version from the site mentioned below.
User would need to identify whether your system architecture is 32-bit or 64-bit. The subsequent command would help you with it.
[root@gateway~]# file /bin/ping
/bin/ping: setuid ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, stripped
As evident, the architecture is 64-bit.
Download the Ioncube package designed for 64-bit systems and extract it to /usr/local/ioncube.
[root@gateway~]# wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
[root@gateway~]# tar -zxf ioncube_loaders_lin_x86-64.tar.gz && mv ioncube /usr/local
Step 2: Identify the PHP version you're running on your system.
[root@gateway~]# php -v
PHP 8.1.26 (cli) (built: Nov 24 2023 08:49:33)
Step 3: Edit the PHP configuration file & add the corresponding Ioncube loader
For Centos 7:
[root@centos7]# vi /etc/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_8.1.so
[root@centos7]# systemctl restart httpd
For Centos 7 Nginx:
[root@centos7]# vi /etc/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_8.1.so
[root@centos7]# systemctl restart nginx
For Centos 8:
[root@centos8]# vi /etc/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.2.so
[root@centos8]# systemctl restart httpd
For RHEL 8:
[root@centos8]# vi /etc/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.2.so
[root@centos8]# systemctl restart httpd
For Ubuntu 16:
root@gateway :~# vi /etc/php/7.0/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.0.so
root@gateway:~# vi /etc/php/7.0/apache2/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.0.so
root@gateway:~# systemctl restart apache2
For Ubuntu 18:
root@gateway :~# vi /etc/php/7.2/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.2.so
root@gateway:~# vi /etc/php/7.2/apache2/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.2.so
root@gateway:~# systemctl restart apache2
For Ubuntu 20:
root@gateway :~# vi /etc/php/7.4/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so
root@gateway:~# vi /etc/php/7.4/apache2/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so
root@gateway:~# systemctl restart apache2
For Ubuntu 22:
root@gateway :~# vi /etc/php/8.1/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_8.1.so
root@gateway:~# vi /etc/php/8.1/apache2/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_8.1.so
root@gateway:~# systemctl restart apache2
For Debian 9:
root@gateway :~# vi /etc/php/7.0/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.0.so
root@gateway:~# vi /etc/php/7.0/apache2/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.0.so
root@gateway:~#
For Debian 10/11:
root@gateway :~# vi /etc/php/7.3/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.3.so
root@gateway:~# vi /etc/php/7.3/apache2/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.3.so
root@gateway:~# systemctl restart apache2
For SUSE LINUX 15:
root@gateway :~# vi /etc/php7/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so
root@gateway:~# vi /etc/php7/apache2/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so
root@gateway:~# apachectl restart
For Debian 9 Nginx:
root@gateway :~# vi /etc/php/7.0/cli/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.0.so
root@gateway:~# vi /etc/php/7.0/fpm/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.0.so
root@gateway:~# systemctl reload nginx.service
root@gateway:~# systemctl reload php7.0-fpm.service
Step 4: Check the PHP version again to see whether Ioncube has been loaded properly.
[root@gateway ~]# php -v
PHP 8.2.19 (cli) (built: May 13 2024 18:20:15) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.19, Copyright (c) Zend Technologies
with the ionCube PHP Loader v13.0.2, Copyright (c) 2002-2023, by ionCube Ltd.
with Zend OPcache v8.2.19, Copyright (c), by Zend Technologies
Related Articles: