How to install Ioncube loader on cPanel servers

First thing you need to do is figure out if you need IonCube installed for your cPanel/WHM scripts or for your Apache/PHP scripts. Figuring this out is simple, if you need IonCube to use a script on your website then you need to install IonCube for your Apache/PHP installation. If you need IonCube to access scripts from within the /cpanel, /whm, or /webmail interface then you need to install IonCube for cPanel/WHM/Webmail. Instructions for doing both are below.

Installing IonCube for cPanel/WHM/Webmail

Both the GUI and CLI methods are listed below

Installing via the WHM

In order to do this you must have administrative privileges, normally the root password.

  • Log into the WHM by going to your servers IP followed by /whm or :2087 (ex: http://127.0.0.1:2087/)
  • On the left hand side click the 'Tweak Settings' link
  • Click the PHP tab on the right hand side
  • Find the configurable option labeled 'cPanel PHP loader' and check the ioncube checkbox
  • Click Save

Installing via the CLI

In order complete this task you must have shell access to the server as the user root

  • Log into the shell as the user root
  • Edit /etc/cpanel/cpanel.config and find the line that starts with phploader=. If there is no value after the equal sign then you can simply append ioncube to it (ex: phploader=ioncube). If there is another loader already in place you can add your new loader by adding a comma first and then adding your loader (ex: phploader=someloader,ioncube)
  • Next execute the following command, /usr/local/cpanel/whostmgr/bin/whostmgr2 –updatetweaksettings
  • And then /usr/local/cpanel/bin/checkphpini
  • and finally /usr/local/cpanel/bin/installphpinis

Installing IonCube Loader for Apache/PHP

There are multiple ways to do this, All have been listed below

Installing IonCube using the CLI version of PHPExtensionManager

This is the preferred method, all it does is install the loaders and does not require you to rebuild Apache and PHP. It's also the fastest method because of this. This method requires you to have shell access to the server as the user root via either the console, SSH, or some other means.

  • Log into the console as root
  • Run /scripts/phpextensionmgr install IonCubeLoader

That's it! That was pretty simple, eh?!

Installing IonCube using the WHM

This method uses the GUI version of easyapache to install the ioncube loader, if you do not want to rebuild Apache and PHP then dont use this method.

  • Log into the WHM as the user root.
  • On the left hand side scroll down and click the EasyApache link
  • Under 'Profile', select 'Previous Saved Config' and click the 'Start customizing based on profile' button.
  • Under 'Apache Version' click 'Next Step'
  • Under 'PHP Version' click 'Next Step'
  • Under 'Short Options List' check the 'Ioncube Loader for PHP' option and click the 'Save and Build' button.
  • This process will take a while to complete, roughly 10-30 minutes depending on your hardware.

Installing IonCube using the CLI version of EasyApache

This method requires you to have shell access as the user root via either the console, SSH or some other means.

  • Log into the console as root
  • Run /scripts/easyapache
  • Select 'Previously Saved Config' and then select 'Start customizing based on profile'
  • Under 'Apache Version' select 'Next Step'
  • Under 'PHP Version' select 'Next Step'
  • Under 'Short Option Lists' check the 'IonCube Loader for PHP' and then select 'Save and Build'
  • This process will take a while to complete, roughly 10-30 minutes depending on your hardware.