Ioncube Loaders are a piece of software that is used to protect the underlying code in PHP applications. Its aim is to obscure the real code so end users can’t steal it. It’s commonly used in licensed software like WHMCS and the popular WHMCS Support Module to name a few. Ioncube was very popular years ago but as companies move to a SaaS (Software as a service) module it’s becoming less relevant. In this guide, we are going to install Ioncube Loaders to an Ubuntu NVMe VPS. The install process is the same for all Linux versions so you can use this guide to Install Ioncube Loaders in CentOS, Debian, Ubuntu, RHEL and of course, AlmaLinux.
Ioncube loaders for PHP 8.0 are not yet available. Even though, at the time of writing this PHP 8.0 has been released for over a year. Some comments from cPanel speculated that Ioncube Loaders for PHP 8.0 would not be released. However, we have now heard that Ioncube will be releasing an update for PHP 8.0. It’s worrying that it took this long. Maybe the move to SaaS is harming the profitability of such software?
Install Ioncube Loaders
- Installing in cPanel? See Install Ioncube Loaders V11 In cPanel
Right. Let’s install Ioncube in Linux. As of writing this, the latest PHP version that can be used with IonCube Loaders is PHP 7.4. On the Ioncube website copy the URL for the latest download. Next, download the latest download to your server. Then, decompress it.
cd /tmp wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz tar -zxvf ioncube_loaders_lin_x86-64.tar.gz cd ioncube ls -lhr
So now you are seeing a list of files in the Ioncube download. We need to copy the correct file for our PHP version. Note the file names. We are using PHP 7.4 so we are only interested in the ioncube_loader_lin_7.4.so file.
Next, we need to learn where to copy the loader too. Issue the command below to find where the extensions are kept.
php -i | grep extension_dir
The returned information will display the path to the extensions folder. In our server. The extensions folder is located at /usr/lib/php/20190902. So now we copy the correct loader to that folder.
cp /tmp/ioncube/ioncube_loader_lin_7.4.so /usr/lib/php/20190902
And finally. We need to tell PHP that we have installed Ioncube Loaders and that it should used them. We do this by appending the location of Ioncube loaders. But first, find all of your PHP.ini files that are in use. You can do this with php –ini
php --ini Configuration File (php.ini) Path: /etc/php/7.4/cli Loaded Configuration File: /etc/php/7.4/cli/php.ini Scan for additional .ini files in: /etc/php/7.4/cli/conf.d Additional .ini files parsed: /etc/php/7.4/cli/conf.d/10-mysqlnd.ini,
So in our server, we need to append the below to the /etc/php/7.4/cli/php.ini file. Then restart Apache.
nano /etc/php/7.4/cli/php.ini # append to bottom of file zend_extension = /usr/lib/php/20190902/ioncube_loader_lin_7.4.so
Finally, when you issue php -v you should notice that the loaders are now loaded into PHP.
But there may also have another php.ini file located at /etc/php/7.0/apache2/php.ini. Ensure you also add the line to that php.ini file. That’s it. Ioncube Loaders have now been installed and you can use applications encoded with Ioncube.
How was this article? Install Ioncube Loaders In Linux
You might also like
More from All About Linux
Open And Close Ports In FirewallD - Manage Zones In FirewallDLike IPtables, FirewallD is a Linux firewall that filters packets …