Articles

Install ionCube Loader

The ionCube Loader is a PHP extension that enables PHP to execute files encoded using the ionCube Encoder.

In this tutorial, we'll show you how to install the ionCube Loader on your servers.

This tutorial assumes you have already connected your server to ServerPilot.

Download, Extract, and Configure

To install the ionCube Loader, SSH in to your server as the root user and run the following commands for the PHP version you're adding the ionCube loader to.

PHP 7.2

ionCube loader support for PHP 7.2 is currently in beta. It should not yet be used in production.

cd /usr/local
sudo wget https://www.ioncube.com/php-7.2.0-beta-loaders/ioncube_loaders_lin_x86-64_BETA.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64_BETA.tar.gz
sudo cp ioncube_loader_lin_7.2_10.1.0_beta.so /opt/sp/php7.2/lib/php/extensions/no-debug-non-zts-20170718/ioncube_loader_lin_7.2.so
sudo bash -c 'echo "zend_extension=/opt/sp/php7.2/lib/php/extensions/no-debug-non-zts-20170718/ioncube_loader_lin_7.2.so" > /etc/php7.2-sp/conf.d/20ioncube.ini'
sudo service php7.2-fpm-sp restart

PHP 7.1

cd /usr/local
sudo wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
sudo cp ioncube/ioncube_loader_lin_7.1.so /opt/sp/php7.1/lib/php/extensions/no-debug-non-zts-20160303/
sudo bash -c 'echo "zend_extension=/opt/sp/php7.1/lib/php/extensions/no-debug-non-zts-20160303/ioncube_loader_lin_7.1.so" > /etc/php7.1-sp/conf.d/20ioncube.ini'
sudo service php7.1-fpm-sp restart

PHP 7.0

cd /usr/local
sudo wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
sudo cp ioncube/ioncube_loader_lin_7.0.so /opt/sp/php7.0/lib/php/extensions/no-debug-non-zts-20151012/
sudo bash -c 'echo "zend_extension=/opt/sp/php7.0/lib/php/extensions/no-debug-non-zts-20151012/ioncube_loader_lin_7.0.so" > /etc/php7.0-sp/conf.d/20ioncube.ini'
sudo service php7.0-fpm-sp restart

PHP 5.6

cd /usr/local
sudo wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
sudo cp ioncube/ioncube_loader_lin_5.6.so /opt/sp/php5.6/lib/php/extensions/no-debug-non-zts-20131226/
sudo bash -c 'echo "zend_extension=/opt/sp/php5.6/lib/php/extensions/no-debug-non-zts-20131226/ioncube_loader_lin_5.6.so" > /etc/php5.6-sp/conf.d/20ioncube.ini'
sudo service php5.6-fpm-sp restart

PHP 5.5

cd /usr/local
sudo wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
sudo cp ioncube/ioncube_loader_lin_5.5.so /opt/sp/php5.5/lib/php/extensions/no-debug-non-zts-20121212/
sudo bash -c 'echo "zend_extension=/opt/sp/php5.5/lib/php/extensions/no-debug-non-zts-20121212/ioncube_loader_lin_5.5.so" > /etc/php5.5-sp/conf.d/20ioncube.ini'
sudo service php5.5-fpm-sp restart

PHP 5.4

cd /usr/local
sudo wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
sudo cp ioncube/ioncube_loader_lin_5.4.so /opt/sp/php5.4/lib/php/extensions/no-debug-non-zts-20100525/
sudo bash -c 'echo "zend_extension=/opt/sp/php5.4/lib/php/extensions/no-debug-non-zts-20100525/ioncube_loader_lin_5.4.so" > /etc/php5.4-sp/conf.d/20ioncube.ini'
sudo service php5.4-fpm-sp restart

Verifying ionCube Loader Is Installed

In the commands shown, replace "X.Y" with your app's PHP version (for example, "5.6" or "7.1").

You can verify the ionCube Loader extension is installed correctly by running this command:

phpX.Y-sp -i | grep -i ioncube

You should see output like the following:

Additional .ini files parsed => /etc/phpX.Y-sp/conf.d/20ioncube.ini,
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.0.0 (), Copyright (c) 2002-2017, by ionCube Ltd.
ionCube Loader

Uninstalling IonCube Loader

In the commands shown, replace "X.Y" with your app's PHP version (for example, "5.6" or "7.1").

To remove ionCube loader from a PHP version you had previously installed it on, run the following commands as root.

sudo rm /etc/phpX.Y-sp/conf.d/20ioncube.ini
sudo service phpX.Y-fpm-sp restart

Last updated: October 30, 2017