How To

Enable ionCube and SourceGuardian PHP Loader on cPanel

Some commercial PHP applications ship their source code in an encoded format that requires a runtime loader to execute. The two most common loaders are ionCube and SourceGuardian. If your cPanel server hosts software like WHMCS, Blesta, or other licensed PHP applications, you will need one or both of these loaders enabled. This guide covers how to enable ionCube Loader and SourceGuardian on cPanel/WHM servers running PHP 8.x.

Original content from computingforgeeks.com - post 63243

What Are ionCube and SourceGuardian?

ionCube Loader is a PHP extension that decodes and executes PHP files that were encoded with the ionCube Encoder. It is the most widely used PHP source protection tool. Many commercial hosting panels, billing systems, and plugins require it.

SourceGuardian Loader serves the same purpose but uses a different encoding format. Some software vendors choose SourceGuardian over ionCube, so you may need both depending on your application stack.

Both loaders work as PHP extensions (shared objects loaded via php.ini). They need to match the exact PHP version and architecture running on your server.

Prerequisites

  • cPanel/WHM server with root access
  • PHP 8.0, 8.1, 8.2, or 8.3 installed via EasyApache 4
  • SSH access to the server

Method 1 – Enable ionCube via WHM MultiPHP Manager

cPanel includes ionCube Loader in its EasyApache 4 PHP builds by default on many versions. Check if it is already available before doing any manual work.

Check via WHM

  1. Log in to WHM as root.
  2. Navigate to Software > MultiPHP INI Editor.
  3. Select the Editor Mode tab.
  4. Choose your PHP version from the dropdown (for example, ea-php83).
  5. Search for ioncube in the configuration. If you see a line loading the ionCube extension, it is already active.

Alternatively, go to Software > MultiPHP Manager and check the PHP Extensions section for your PHP version. If ionCube Loader appears in the list, enable it with the checkbox.

Install via EasyApache 4

If ionCube is not listed, install it through EasyApache:

  1. In WHM, go to Software > EasyApache 4.
  2. Click Customize on your current profile.
  3. Go to the PHP Extensions tab.
  4. Search for ioncube.
  5. Enable the ionCube extension for your PHP version(s).
  6. Click Review and then Provision.

EasyApache rebuilds PHP with the ionCube extension included.

Method 2 – Manual ionCube Installation via SSH

If the EasyApache method does not work for your PHP version, install ionCube manually.

Download the latest ionCube loaders:

cd /tmp
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar -xzf ioncube_loaders_lin_x86-64.tar.gz

Identify which PHP version you need the loader for. List installed EA PHP versions:

ls /opt/cpanel/ea-php*/root/usr/bin/php

Check the PHP version string and extension directory:

/opt/cpanel/ea-php83/root/usr/bin/php -i | grep -E "extension_dir|PHP Version"

Copy the correct loader file. For PHP 8.3:

cp /tmp/ioncube/ioncube_loader_lin_8.3.so /opt/cpanel/ea-php83/root/usr/lib64/php/modules/

Create an INI file to load the extension. ionCube must load before other extensions, so use a filename that sorts first (the 00 prefix):

echo "zend_extension=ioncube_loader_lin_8.3.so" > /opt/cpanel/ea-php83/root/etc/php.d/00-ioncube.ini

Restart PHP-FPM for the changes to take effect:

systemctl restart ea-php83-php-fpm

Enable SourceGuardian Loader

SourceGuardian is not included in EasyApache, so manual installation is required.

Download the SourceGuardian loaders:

cd /tmp
wget https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
tar -xzf loaders.linux-x86_64.tar.gz

Copy the correct loader for your PHP version. For PHP 8.3:

cp /tmp/ixed.8.3.lin /opt/cpanel/ea-php83/root/usr/lib64/php/modules/

Create the INI file:

echo "extension=ixed.8.3.lin" > /opt/cpanel/ea-php83/root/etc/php.d/01-sourceguardian.ini

Restart PHP-FPM:

systemctl restart ea-php83-php-fpm

Verify with phpinfo()

Create a temporary phpinfo file to confirm the loaders are active:

echo "<?php phpinfo(); ?>" > /home/USERNAME/public_html/info.php

Replace USERNAME with an actual cPanel account. Open https://yourdomain.com/info.php in your browser and search for:

  • ionCube – Look for the “ionCube PHP Loader” section showing the loader version and supported PHP version.
  • SourceGuardian – Look for the “SourceGuardian” section showing the loader version.

You can also verify from the command line:

/opt/cpanel/ea-php83/root/usr/bin/php -v

The output should mention both loaders:

PHP 8.3.x (cli) ...
    with the ionCube PHP Loader v13.x ...
    with SourceGuardian v14.x ...

Remove the phpinfo file when done – leaving it exposed is a security risk:

rm -f /home/USERNAME/public_html/info.php

Common Issues and Fixes

“Cannot load ionCube Loader – incompatible module API” – You copied a loader compiled for the wrong PHP version. Double-check the PHP version number in the .so filename matches your installed PHP version exactly.

ionCube loads but encoded files still fail – The encoded files may have been encoded for a newer ionCube version than your loader. Update the loader to the latest version from the ionCube website.

“Unable to initialize module” for SourceGuardian – Make sure you are using extension= (not zend_extension=) in the SourceGuardian INI file. SourceGuardian is a regular PHP extension, not a Zend extension.

Loaders disappear after EasyApache rebuild – If you installed manually and then ran an EasyApache profile update, the INI files may be overwritten. Re-copy the loader files and re-create the INI files after EasyApache runs. Consider adding a post-provision hook script.

PHP-FPM not restarting – Check the service name matches your PHP version: systemctl status ea-php83-php-fpm. If PHP is running under DSO or CGI instead of FPM, restart Apache instead: systemctl restart httpd.

Wrapping Up

Enabling ionCube and SourceGuardian on a cPanel server is straightforward once you know which PHP version your applications need. The WHM/EasyApache method works well for ionCube on supported PHP versions. For SourceGuardian or when EasyApache does not offer the extension, manual installation via SSH takes just a few minutes. Always verify with phpinfo() after making changes, and remember to remove the phpinfo file once you are done testing.

Related Articles

Ubuntu Install Chatwoot on Ubuntu 24.04 with Let’s Encrypt SSL Debian Install WordPress on Debian with Apache and Let’s Encrypt Rocky Linux Install Apache, MariaDB, PHP (LAMP) on Rocky Linux 9 AlmaLinux Install Caddy Web Server on Rocky / AlmaLinux 9|8

Leave a Comment

Press ESC to close