To start, you will have to figure out if you want IonCube installed for your cPanel/WHM scripts or for your Apache/PHP scripts. It’s pretty easy to know if you require IonCube, you will need IonCube in order to access scripts from inside the /cpanel, or /whm, or /webmail interface then you have to get IonCube for cPanel/WHM /webmail. Below you will see the steps for both.
Installing IonCube for cPanel/WHM/Webmail
You will see both the GUI and the CLI methods below.
Installing via the WHM
To follow the steps below you will need administrative privileges, usually the root password.
Step 1: Begin by logging into WHM, you can do this by going to your servers IP followed by /whm or :2087 for example, http://127.0.0.1:2087/
Step 2: Once you went to your servers IP, on the left hand side you will see a Tweak settings link, click it.
Step 3: Now, we will click on the PHP tab on the right hand side.
Step 4: Look for the configurable option called ‘cPanel PHP loader’ and check the ioncube checkbox.
Step 5: Lastly, we will click on ‘Save’.
Installing via the CLI
To follow the steps below you need to have shell access to the server as the user root.
Step 1: Start by logging into the shell as the user root.
Step 2: Modify /etc/cpanel/cpanel.config and look for the line which starts with phploader=. If you see no value after the equal sign then you just have to add ioncube to it, as such phploader=ioncube. If you have another loader which is in place, you could just append your new loader by appending a comma first and then appending your loader (phploader=exampleloader,ioncube)
Step 3: Now, run the next command, /usr/local/cpanel/whostmgr/bin/whostmgr2 –updatetweaksettings
Step 4: Next, execute this: /usr/local/cpanel/bin/checkphpini
Step 5: And lastly, /usr/local/cpanel/bin/install_php_inis
Installing IonCube Loader for Apache/PHP
You have several ways to do this, they will all be listed below.
Installing IonCube using the CLI version of PHPExtensionManager
The recommended method is the following one, and what it will do is install the loaders and will not need you to rebuild Apache and PHP. It’s also the quickest method because of this. In this method you will need shell access to the server as the user root via either the console or SSH, or any other means.
Step 1: Begin by logging into the console as root.
Step 2: Then, execute the following: /scripts/phpextensionmgr install IonCubeLoader
This is all, pretty simple and fast, ain’t it.
Installing IonCube using the WHM
In the next method, we will use the GUI version of easyapache to install the ioncube loader, if you are not interested in rebuilding Apache and PHP then just don’t use this method.
Step 1: Start by logging into the WHM as the user root.
Step 2: Once you are at the WHM interface, on the left hand side scroll down and click on the EasyApache link.
Step 3: Below ‘Profile’, choose ‘Previous Saved Config’ and click on ‘Start customizing based on profile’ button.
Step 4: Below ‘Apache Version’ click on ‘Next Step’
Step 5: Now, below ‘PHP version’ we again, click on ‘Next Step’
Step 6: Below the ‘Short Options list’ check the ‘ioncube Loader for PHP’ option and then press on ‘Save and Build’.
Step 7: This procedure should take a little bit to finish, it will be roughly 10-30 minutes, depending on your hardware.