GoAdmio

ioncube

Download the ionCube Loader and enable it for every installed PHP version (FPM and CLI)

On this page: Overview · Quick start · Requirements · Syntax · Output · Examples · Troubleshooting · Details · See also


Overview

/go/ioncube installs the ionCube Loader, which PHP needs to run files that were encoded with ionCube. It:

It is safe to run again. A version that already has the loader is reported and left alone.


Quick start

/go/ioncube

Requirements


Syntax

/go/ioncube

The command has no arguments or options. A domain can be given as the first argument, but it is not used.


Output

Outcome What you get
Loader added Installing ionCube loader PHP <x.y> (FPM)..., and on Debian and Ubuntu also (CLI)
Loader already in php.ini ionCube loader PHP <x.y> already installed (FPM). or (CLI).
No loader for that PHP version Nothing is printed.
Download or unpack failed Nothing is printed.

The download and unpack steps are silent. The exit code is 0.

Logging

Every run is appended to /var/log/go/ioncube.log.


Examples

# Install or refresh the loader for all PHP versions
/go/ioncube
# Check which loader files are available
ls /usr/local/ioncube
# Check that a PHP version loads it (Debian and Ubuntu)
php8.3 -v
# Check that a PHP version loads it (AlmaLinux, Rocky, CentOS, Red Hat, Fedora)
/opt/remi/php83/root/usr/bin/php -v

The version line should end with with the ionCube PHP Loader.


Troubleshooting

Symptom Likely cause Fix
No message for one of the PHP versions The downloaded package has no loader for that version, for example a very new one. Check ls /usr/local/ioncube. Use a PHP version that has a loader, with multiphp.
Failed loading /usr/local/ioncube/... on every PHP start The loader folder was removed and the new download failed, but php.ini still points to it. Run the command again with internet access, or remove the zend_extension line from php.ini.
The loader files were updated, but PHP still uses the old one PHP-FPM is restarted only when a line was added to php.ini. Restart it with fpm.
Encoded files still show an ionCube error The site runs on Apache's PHP module, or on a PHP version without a loader, or FPM wasn't restarted. The command doesn't change apache2/php.ini. Check the site's PHP version, and restart PHP-FPM.
The loader doesn't work on an ARM server Only the x86-64 package is downloaded. Install the ARM (aarch64) loader by hand.
The loader is reported as installed, but isn't active The check also matches a commented-out line. Remove the comment sign, or delete the line and run the command again.
Permission denied The command wasn't run as root. Run it as root.
The file ioncube_loaders_lin_x86-64.tar.gz is left in the current folder The run was interrupted. Delete it.

Details

What it does

  1. Logs the call, and reads the operating system name.
  2. Deletes /usr/local/ioncube and any old copy of ioncube_loaders_lin_x86-64.tar.gz in the current folder.
  3. Downloads https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz into the current folder, and unpacks it into /usr/local.
  4. For every installed PHP version, if /usr/local/ioncube/ioncube_loader_lin_<x.y>.so exists and the php.ini doesn't mention it yet: adds zend_extension = /usr/local/ioncube/ioncube_loader_lin_<x.y>.so at the end of the php.ini.
  5. Deletes the downloaded package.
  6. If any line was added, restarts PHP-FPM with fpm.

Which files are changed

System Files Version
AlmaLinux, Rocky, CentOS, Red Hat, Fedora /etc/opt/remi/<version>/php.ini (one file per version, used by FPM and CLI) The first two digits of the folder name, for example php83 gives 8.3
Debian, Ubuntu /etc/php/<version>/fpm/php.ini and /etc/php/<version>/cli/php.ini The folder name, for example 8.3

The command doesn't change /etc/php.ini, Apache's apache2/php.ini, or the files in the conf.d folders. The script also has an OpenSUSE branch, but it does nothing.

flowchart TD
    A["ioncube"] --> B["Delete /usr/local/ioncube"]
    B --> C["Download and unpack the loader package"]
    C --> D["For each installed PHP version"]
    D --> E{"Loader file exists?"}
    E -- "No" --> F["Skip silently"]
    E -- "Yes" --> G{"php.ini already mentions it?"}
    G -- "Yes" --> H["Report already installed"]
    G -- "No" --> I["Append zend_extension line"]
    I --> J["Restart PHP-FPM at the end"]

Notes for maintainers

Issue Why it matters Suggested fix
/usr/local/ioncube is deleted before the new download is checked A failed download leaves php.ini pointing at missing files. Download to a temporary folder, check it, then replace the old folder.
The download and unpack results are never checked, and the downloaded package is not verified A failed or corrupt download goes unnoticed, and code from the download is loaded into every PHP process. Check the exit codes, and verify the checksum published by ionCube.
The package is downloaded into the current folder Leftover files, and it needs a writable folder. Use mktemp -d.
The x86-64 package is hard-coded Doesn't work on ARM servers. Pick the package from uname -m.
There is no root check, and the appends have no sudo Fails when not run as root. Re-run through sudo at the top, like most other commands.
The "already installed" check matches commented-out lines The loader isn't active, but the command says it is. Match only active lines, for example ^[[:space:]]*zend_extension.
Lines are appended to php.ini Edits can conflict with package upgrades, and the loader should load before other Zend extensions. Use a separate ini file in conf.d with a name that sorts first, such as 00-ioncube.ini.
FPM is restarted only when a line was added Updated loader files stay unused until a manual restart. Also restart when the package changed. A graceful reload may be enough.
Versions without a loader are skipped silently Users can't tell why a version is missing. Print a message.
Debian and Ubuntu apache2/php.ini and the OpenSUSE branch are not handled Apache's PHP module doesn't get the loader. The OpenSUSE branch is dead code. Handle them, or remove the dead branch.
The version is taken from the first two digits of the folder name Breaks for names that don't follow that pattern. Read the version from the PHP binary.
Domain, WS, and MySQLRootPassword are set but never used The database root password is loaded for no reason. Remove them.

See also

Command Description
installphp Install a different PHP version on GoAdmio
multiphp Manage PHP versions per domain
listphp List the available PHP versions on a GoAdmio server
extension List, install, or remove PHP extensions across every version
fpm Restart all installed PHP-FPM versions on your server
encoder Encode PHP code in GoAdmio
checkphpini Scan every php.ini for startup errors and remove the offending line