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 (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.
Download the appropriate version of the loaders:
Now decompress the loaders you just downloaded:
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:
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.
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.
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.
Now you can check each PHP version to see if it is loading the ionCube loaders properly.
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.
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:
- Log into NodeWorx as the primary admin user. Example: https://your.server.com:2443/
- In the System Services section, select Web Server.
- Restart Apache by clicking the small circular icon in between the start and stop icons.
- If you are using PHP-FPM, click the Restart button in the Restart PHP-FRPM section below the Web Server Control section.
- 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.
- 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.