ionCube Loader is a PHP extension that works to decode PHP scripts previously encoded by the ionCube PHP Encoder package.
The following information is provided as a guide for installing the ionCube loader needed to run PHP files encoded with ionCube on DreamHost servers.
In order to install ionCube Loader on a DreamHost account, please make sure your site is running on PHP 5.6 or above. View the following article for instructions on how to choose a version of PHP:
ionCube loader and PHP 7.0
ionCube Loader will currently not function with sites running PHP 7.0 at DreamHost.
PHP 7.0 has also been EOL'd by php.net. For security purposes, you should update your site to run on PHP 7.1, 7.2, or 7.3.
Checking the version of PHP your site uses
Even after you have set the PHP version in your panel, you should still check to confirm that version is the one running on your site. You can easily do this by creating a file named phpinfo.php in your website’s directory with the following code:
Checking which version of ionCube loader you need
- Visit your phpinfo.php file in a browser.
- Check which version of the ionCube loader package for Linux you need to use by inspecting the first section of the output of the phpinfo.php file you just added.
- When you view that file in a browser, look at the ‘System’ section.
- For example, consider the following phpinfo() output:
System Linux wowbagger 3.2.61-grsec-modsign #1 SMP Tue Aug 12 09:58:26 UTC 2014 x86_64
- In this example, the "x86_64" following the time stamp information indicates you would need the "x86-64" version of the ionCube loader package.
Downloading ionCube loader
This guide assumes you're installing an "x86" version of the loader package, and that you are installing ionCube into /home/username/ioncube. Visit the ionCube Loaders download page for any other specific version you may need.
Downloading via FTP
- Use one of the links below to download the Ioncube loader file that matches your PHP version.
- Connect to your domain via FTP.
- Navigate to your users directory under /home/<username>/. This is identifiable by looking for the /logs and /Maildir folders. View the FTP article for details.
- In this same directory, create a new directory named 'ioncube'.
- Navigate into this new /ioncube folder.
- Upload the .so file here.
Downloading via SSH
- Log into your server via SSH.
- Once logged in, run the following commands in order:
[server]$ cd ~ [server]$ mkdir ioncube [server]$ cd ioncube [server]$ wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz [server]$ tar -zxvf ioncube_loaders_lin_x86-64.tar.gz -C $HOME [server]$ rm ioncube_loaders_lin_x86-64.tar.gz
You now have several files in your /home/username/ioncube directory and they appear as the following:
Installing ionCube loader
If you have configured your fully hosted domain with PHP 5.6 or above and FastCGI, the installation is very simple.
- Create a phprc file using an FTP client or SSH.
- Once the 'phprc' file has been created, add the following directive to it. View the following articles for instructions on how to edit a file:
This example uses PHP 7.2. Make sure to change the version number to the PHP version you're using. Also make sure to replace 'username' with your actual shell username.
zend_extension = /home/username/ioncube/ioncube_loader_lin_7.2.so
- Confirm that the directive is on only one line, and the first line, in the phprc file.
- Save this file.
- Kill off all PHP processes to complete the installation:
- To test it, copy the loader-wizard.php file from the /home/username/ioncube directory to a public place in your domain’s web directory.
- Load that file in a browser.
- Answer the questions about "shared hosting" and it should successfully report that ionCube is installed.
- Remove the loader-wizard.php file for security reasons.
If you have problems, check the ionCube Forum.
Confirming it's loaded
You can now confirm if ionCube is loaded by viewing your phpinfo.php file. You will see the following:
Can I use IonCube Loader with DreamPress?
ionCube Loader is not supported with DreamPress. ionCube's website states that it's purpose is to "makes it easy to protect PHP source code from easy observation, theft and change by compiling to bytecode." Since the WordPress software is open source, there is never a reason to use ionCube Loader to hide your code.