Skip to main content

Install IonCube Loader on InterWorx

While InterWorx automatically installs many PHP modules via RPMs, there aren't any available for ionCube's PHP loaders.

Installing ionCube on an InterWorx Server with MultiPHP

⚠️ By default, InterWorx servers utilize the system installed version of PHP, which in CentOS or RHEL 7 happens to be PHP 5.4, but most admins end up enabling multiple versions of PHP. These directions will assume that you have all currently available versions of PHP installed. This includes:

PHP 5.4 (the system installed version)

PHP 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, and 7.4 (these are installed from the remi-safe RPM repository)

If you only have some or only one of these installed, then only follow the directions for the version(s) of PHP that you use.

Installing the ionCube loaders follow the same basic process regardless of the version of PHP you are installing it in, but the exact locations vary depending on the PHP version itself.

Download and Decompress the Latest ionCube Loaders

HostDime only sells 64-bit servers, so although ionCube is available in 32-bit and 64-bit versions, these directions will only cover the 64-bit version.

  1. Download the appropriate version of the loaders:

    Download command for 64-bit Loaders

    cd; wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
  2. Now decompress the loaders you just downloaded:

    Decompress command the 64-Bit Version

    tar xfz ioncube_loaders_lin_x86-64.tar.gz
  3. Enter the ioncube loader directory you just decompressed and change the permissions of the .so files to 755 and for safety, change the ownership to root:

    cd ioncube
    chmod 755 *.so
    chown root: *.so

Copy the Loaders to the Appropriate PHP Module Directory

Now you need to copy the loader(s) into the proper location for each version of PHP you have installed.

✅ These commands assume you're already in the ioncube directory.

  • CentOS 7 64-Bit System PHP 5.4

    cp -p ioncube_loader_lin_5.4.so /usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 5.4

    cp -p ioncube_loader_lin_5.4.so /opt/remi/php54/root/usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 5.5

    cp -p ioncube_loader_lin_5.5.so /opt/remi/php55/root/usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 5.6

    cp -p ioncube_loader_lin_5.6.so /opt/remi/php56/root/usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 7.0

    cp -p ioncube_loader_lin_7.0.so /opt/remi/php70/root/usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 7.1

    cp -p ioncube_loader_lin_7.1.so /opt/remi/php71/root/usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 7.2

    cp -p ioncube_loader_lin_7.2.so /opt/remi/php72/root/usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 7.3

    cp -p ioncube_loader_lin_7.3.so /opt/remi/php73/root/usr/lib64/php/modules/
  • 64-Bit Remi Repo PHP 7.4

    cp -p ioncube_loader_lin_7.4.so /opt/remi/php74/root/usr/lib64/php/modules/

Add the ionCube Configuration to PHP

Now that you've put the loader in place, we need to tell PHP that it is there so that PHP can load the module.

✅ Only follow the directions for versions of PHP that you have installed.

  • CentOS 7 64-Bit System PHP 5.4

    echo "zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.4.so" > /etc/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 5.4

    echo "zend_extension = /opt/remi/php54/root/usr/lib64/php/modules/ioncube_loader_lin_5.4.so" > /opt/remi/php54/root/etc/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 5.5

    echo "zend_extension = /opt/remi/php55/root/usr/lib64/php/modules/ioncube_loader_lin_5.5.so" > /opt/remi/php55/root/etc/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 5.6

    echo "zend_extension = /opt/remi/php56/root/usr/lib64/php/modules/ioncube_loader_lin_5.6.so" > /etc/opt/remi/php56/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 7.0

    echo "zend_extension = /opt/remi/php70/root/usr/lib64/php/modules/ioncube_loader_lin_7.0.so" > /etc/opt/remi/php70/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 7.1

    echo "zend_extension = /opt/remi/php71/root/usr/lib64/php/modules/ioncube_loader_lin_7.1.so" > /etc/opt/remi/php71/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 7.2

    echo "zend_extension = /opt/remi/php72/root/usr/lib64/php/modules/ioncube_loader_lin_7.2.so" > /etc/opt/remi/php72/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 7.3

    echo "zend_extension = /opt/remi/php73/root/usr/lib64/php/modules/ioncube_loader_lin_7.3.so" > /etc/opt/remi/php73/php.d/00-ioncube.ini
  • 64-Bit Remi Repo PHP 7.4

    echo "zend_extension = /opt/remi/php74/root/usr/lib64/php/modules/ioncube_loader_lin_7.4.so" > /etc/opt/remi/php74/php.d/00-ioncube.ini

Restart Apache and PHP-FPM

Now that everything is ready, you need to restart Apache and PHP-FPM if you are using it. This will cause the system to actively start using ionCube.

You have two ways you can restart Apache or PHP-FPM, you can run a command via the command line if you're running as the root user OR you can restart these things from NodeWorx.

Restart Apache and PHP-FPM via Command Line

Since you are already logged into the command line as root, it's probably easiest to restart Apache and PHP this way. Select the appropriate commands from the list below.

  • Restart Apache on CentOS 7

    systemctl restart httpd
  • Restart PHP-FPM on CentOS 7

    systemctl restart php-fpm
    systemctl restart php54-php-fpm
    systemctl restart php55-php-fpm
    systemctl restart php56-php-fpm
    systemctl restart php70-php-fpm
    systemctl restart php71-php-fpm
    systemctl restart php72-php-fpm
    systemctl restart php73-php-fpm
    systemctl restart php74-php-fpm

    Now you can check each PHP version to see if it is loading the ionCube loaders properly.

  • Check Installed Versions of PHP to see if ionCube is Active

    php -i | grep ioncube
    /opt/remi/php54/root/bin/php -i | grep ioncube
    /opt/remi/php55/root/bin/php -i | grep ioncube
    /opt/remi/php56/root/bin/php -i | grep ioncube
    /opt/remi/php70/root/bin/php -i | grep ioncube
    /opt/remi/php71/root/bin/php -i | grep ioncube
    /opt/remi/php72/root/bin/php -i | grep ioncube
    /opt/remi/php73/root/bin/php -i | grep ioncube
    /opt/remi/php74/root/bin/php -i | grep ioncube
  • The output from these various commands should look something like this if ionCube is working. If nothing is output, review the changes you made and ensure that they were made correctly for versions of PHP that you actually have installed.

    # /opt/remi/php73/root/bin/php -i | grep ioncube
    Additional .ini files parsed => /etc/opt/remi/php73/php.d/00-ioncube.ini,
    For Loader updates visit www.ioncube.com/loaders.php
    For support visit support.ioncube.com
    This Loader also includes features for real-time error reporting and malware protection. Visit ioncube24.com for more details.
    ioncube.loader.encoded_paths => no value => no value

Restart Apache and PHP-FPM via NodeWorx

If you'd like to use the NodeWorx GUI to restart Apache and PHP-FPM, you can follow these steps:

  1. Log into NodeWorx as the primary admin user. Example: https://your.server.com:2443/

  2. In the System Services section, select Web Server.

  3. Restart Apache by clicking the small circular icon in between the start and stop icons.
    Click the Circle Icon Under Action for the Web
Server

  4. If you are using PHP-FPM, click the Restart button in the Restart PHP-FPM section below the Web Server Control section.
    Click the Restart button to Restart all Active PHP-FPM
Processes

  5. If everything restarted properly, you can check the system installed version of PHP to see if ioncube is enabled. Click on the PHP Info button in the PHP Information section.
    Click the PHP Info Button to View the PHP Info
Screen

  6. Scroll down and check for mentions of ionCube. If you see some and it shows as enabled, then you know you did things correctly. To check the other versions of PHP that you have installed, follow the command line directions above since InterWorx does not include a way to check the PHP info of other installed versions of PHP.

Congratulations, you've successfully enabled ionCube in all versions of PHP.