Sometimes you might come across plugins or software that is encrypted with Ioncube, and you might need to install the Ioncube loaders into PHP so that the plugin or software works.
Warning: Ioncube is third party software and isn’t supported by vCanopy. Additionally, if it breaks the server, the server won’t be supported.
That being said, this is pretty safe.
Before you get started, make sure you’ve generated an SSH key and have successfully logged into your server as root. The following guides detail how to do this:
Step 1. Generate your SSH Key
Step 2. Add your SSH Key to vCanopy (also see Add default SSH Keys)
Step 3. Connect to your server by SSH as Root user (we like and use Termius)
For Nginx
STEP 1: DOWNLOAD THE IONCUBE LOADERS
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
STEP 2: EXTRACT THE IONCUBE LOADERS
tar xzf ioncube_loaders_lin_x86-64.tar.gz -C /usr/local
STEP 3: LOAD IT
Add a line to the end of the PHP config files, adjust 7.x to your version (7.2, 7.3, etc), and restart PHP
echo 'zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.x.so' | tee -a /etc/php/7.x/cli/php.ini && echo 'zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.x.so' | tee -a /etc/php/7.x/fpm/php.ini && gp php 7.x restart
Right now the current PHP CLI version is 7.3, so you can run the following:
echo 'zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.3.so' | tee -a /etc/php/7.3/cli/php.ini && echo 'zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.3.so' | tee -a /etc/php/7.3/fpm/php.ini && gp php 7.3 restart
At some point in the future it will be updated to 7.4, so you can also the run the following as well:
echo 'zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so' | tee -a /etc/php/7.4/cli/php.ini && echo 'zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so' | tee -a /etc/php/7.4/fpm/php.ini && gp php 7.4 restart
STEP 4. CONFIRM IT’S WORKING
Run the following:
php -v
The output should look as follows:
PHP 7.3.27-9+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb 23 2021 15:10:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.27, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd.
with Zend OPcache v7.3.27-9+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
You’re done!
For OpenLiteSpeed
STEP 1: INSTALL THE REQUIRED VERSION
apt install lsphp74-ioncube
Replace 74 with the PHP version e.g. 73 for PHP 7.3
STEP 2. CONFIRM IT’S WORKING
Run the following:
/usr/local/lsws/lsphp74/php -v
The output should look as follows:
PHP 7.4.28 (cli) (built: Mar 15 2022 04:25:07) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.1, Copyright (c) 2002-2020, by ionCube Ltd.
with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
You’re done!