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.
Step 1 — Confirm 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:
Visit your phpinfo.php file in a browser. Your PHP version displays at the top. You will need to use the specific ionCube file below for this version of PHP.
Step 2 — Download the ionCube loader files
You can download these files via FTP or SSH.
Downloading via FTP
- Visit the download ionCube page.
- Click the link next to the Linux (64 bits) option.
- On your computer, navigate to the /downloads directory, or wherever you just downloaded the file.
- Extract the zip file. In Windows, right-click and choose Extract All.... This extracts the files into a new folder named ioncube.
- Connect to your domain via FTP.
- In the left pane (your computer), navigate to the directory you just extracted the files into.
- In the right pane (your server), navigate to your user's 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 /home/username/ioncube directory.
- Upload the ioncube_loader_lin_7.#.so file from your computer into this directory.
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:
Step 3 — Install ionCube loader
These steps tell your site to use the ionCube file you just downloaded.
- While logged into your server via FTP or SSH, navigate to the /home/username/.php/php7.# directory. Make sure to navigate into the same number directory as your PHP version above.
- Edit the phprc file on your server to add the following line to it. View the following articles for instructions on how to edit a file:
This example uses PHP 7.4. 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.4.so
- Save this file.
- Kill off all PHP processes to complete the installation:
Step 4 — Confirm 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 the following:
The ionCube Encoder compiles sourcecode to bytecode, can obfuscate and encrypt compiled code if desired, and has features to protect decryption keys in various ways, including a unique approach of algorithmic non-stored keys we call Dynamic Keys.
Since the WordPress software is open source, there is never a reason to use ionCube Loader to hide your code. If you absolutely require ionCube with WordPress, the only options are to downgrade to a VPS or Shared hosting plan.