VPS/Servers management guides

How to Install ionCube Loader on Debian 13 and Ubuntu 26.04 LTS

Download the ionCube Loader, match it to your PHP version, load it for PHP-FPM, Apache and the CLI on Debian 13 or Ubuntu 26.04 LTS, and verify it.

The ionCube Loader is a free PHP extension that runs PHP files protected with the commercial ionCube Encoder. Billing systems, licensed plugins and other closed-source PHP applications refuse to start without it. This guide installs the Loader on Debian 13 (PHP 8.4) and Ubuntu 26.04 LTS (PHP 8.5) for the command line, PHP-FPM and Apache's PHP module. The steps are the same on Debian 12 (PHP 8.2) and Ubuntu 24.04 LTS (PHP 8.3); only the version number in the paths changes, and the commands below work it out for you.

Requirements

  • A Debian or Ubuntu server with PHP already installed from the distribution packages (or from a repository that uses the same /etc/php/X.Y/ layout).
  • A user with sudo rights.
  • A PHP version that ionCube supports. Current Loaders (version 15.5 at the time of writing) cover PHP 8.1 to 8.5 as well as PHP 7.x and older. There is no Loader for PHP 8.0; ionCube skipped that version.

Step 1: Check your PHP version, architecture and thread safety

php -v
dpkg --print-architecture
php -i | grep -E '^(extension_dir|Thread Safety)'

Note three things:

  • The PHP version, for example 8.4. Only the first two numbers matter.
  • The architecture: amd64 needs the x86-64 Loader package, arm64 needs the aarch64 package.
  • Thread safety. Distribution PHP packages are built without it (Thread Safety => disabled), so you need the plain Loader file, not the one ending in _ts.so.

If the web server uses a different PHP version than the command line, which can happen when several versions are installed side by side, repeat the installation steps for each version and call the versioned binary, for example php8.4, instead of php.

Step 2: Download and unpack the Loader

On amd64:

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

On arm64, use the aarch64 archive instead:

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

Both archives unpack into a directory named ioncube that holds one Loader per PHP version:

ls /tmp/ioncube

You are looking for ioncube_loader_lin_8.4.so on Debian 13 or ioncube_loader_lin_8.5.so on Ubuntu 26.04. If there is no file for your PHP version, the Loader does not support it yet and no configuration trick will change that.

Step 3: Copy the Loader into the PHP extension directory

These commands read the version and the extension directory from PHP itself, so they are the same on every release:

PHPV=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
EXTDIR=$(php -r 'echo ini_get("extension_dir");')
echo "PHP $PHPV, extensions in $EXTDIR"
sudo cp /tmp/ioncube/ioncube_loader_lin_${PHPV}.so "$EXTDIR/"

Step 4: Load it before every other Zend extension

The Loader must be the first zend_extension that PHP loads; if another Zend extension such as Xdebug comes first, PHP reports an error at startup. Debian and Ubuntu read the files in each conf.d directory in alphabetical order, so a file name starting with 00- guarantees the position.

Create the configuration once and link it into every SAPI that is installed (CLI, PHP-FPM, Apache module):

echo "zend_extension=${EXTDIR}/ioncube_loader_lin_${PHPV}.so" | sudo tee /etc/php/${PHPV}/mods-available/ioncube.ini
for sapi in cli fpm apache2 cgi; do
  if [ -d /etc/php/${PHPV}/${sapi}/conf.d ]; then
    sudo ln -sf /etc/php/${PHPV}/mods-available/ioncube.ini /etc/php/${PHPV}/${sapi}/conf.d/00-ioncube.ini
  fi
done

Run these in the same shell session as Step 3, because they reuse the PHPV and EXTDIR variables.

Step 5: Restart PHP and verify

Restart whichever service runs PHP for your sites. With PHP-FPM (the usual setup behind Nginx or Apache with proxy_fcgi):

sudo systemctl restart php${PHPV}-fpm

With Apache's mod_php:

sudo systemctl restart apache2

Check the command line first:

php -v

The output now contains a line beginning with the ionCube PHP Loader followed by the Loader version. You can also list it explicitly:

php -m | grep -i ioncube

The command line and the web server use separate configuration directories, so confirm the web side as well. The simplest check is to open your encoded application: the message that the ionCube Loader is missing should be gone. Alternatively, copy loader-wizard.php from /tmp/ioncube into a site's document root, open it in a browser, and delete it again when it reports that the Loader is installed.

Finally, remove the downloaded files:

rm -rf /tmp/ioncube /tmp/ioncube_loaders_lin_*.tar.gz

Keeping the Loader working

  • PHP upgrades: the Loader is tied to the PHP minor version. Security updates within 8.4 do not affect it, but after a release upgrade that moves you to a new PHP version (for example Debian 12 to 13) you must repeat Steps 2 to 5 for the new version, or PHP will run without the Loader.
  • Loader updates: the Loader is not managed by apt. To update it, download the archive again, copy the new .so over the old one and restart PHP. The current version and its release notes are on the ionCube Loaders page.
  • Removal: delete the 00-ioncube.ini links and mods-available/ioncube.ini, then restart PHP.

Troubleshooting

  • "The Loader must appear as the first entry in the php.ini file": another zend_extension line is read before the Loader, usually one added directly to php.ini. Move that line into its own conf.d file or remove it.
  • "Failed loading ... cannot open shared object file": the path in ioncube.ini is wrong or the file was copied for a different PHP version. Compare it with php -i | grep extension_dir.
  • Works on the CLI but not on the website: PHP-FPM or Apache was not restarted, or the site runs a different PHP version than the CLI. Check which FPM services are running with systemctl list-units 'php*-fpm*'.
  • The application says the file was encoded for a different PHP version: this is a limit of the encoded files, not of your installation. See the first question below.

Frequently asked questions

Will files encoded for an older PHP version run on PHP 8.4 or 8.5?

Not necessarily. Encoded files contain compiled bytecode for a specific PHP generation. According to ionCube's release notes, the PHP 8.4 Loader runs files produced by the PHP 8.2, 8.3 and 8.4 encoders. Files encoded for PHP 7.x or 8.1 need that PHP version, so ask the software vendor for a build that matches your PHP before you upgrade the operating system.

Is the ionCube Loader free?

Yes. The Loader is free to download and use; only the Encoder, which vendors use to protect their code, is a paid product. The Loader is closed source, which is why it is not in the Debian or Ubuntu archives.

Does the Loader work together with OPcache?

Yes. OPcache is the standard companion and the two are designed to run side by side. On Debian 13 the Loader simply needs to be read before OPcache, which the 00- prefix takes care of. Debugging extensions such as Xdebug are a different matter and are best left disabled on servers that run encoded code.

How do I install it on AlmaLinux or Rocky Linux?

The Loader files are the same, but the PHP paths differ: the extension directory is under /usr/lib64/php/modules and the configuration goes into /etc/php.d. The principle of a 00-ioncube.ini file that loads first applies there as well.

Share story:

Continue reading other guides on How VPS.