Install ionCube on DreamHost Server

IonCube is used to encode the PHP files and make the PHP file more secure. If the author of the program does not want users to see their PHP coding in the file then the author can encode the PHP files using ionCube.

If you want to run ionCube encoded program on your server then you need to have a file called ionCube loader on your server for the installed PHP program. Once you have ionCube loader on your server then only you can read ionCube encoded files on the server.

The Easy Way to Install ionCube Loader

When I needed to install ionCube loader on my server, I first went to DreamHost wiki and read the instructions there. I found that the instructions are very lengthy and complex for one to follow. So I searched another way to install ionCube loader and I found the readymade ionCube loader install script at http://sxi.sabrextreme.com/dh-phpion. Using that script I was able to install the loader on DreamHost server.

Now many things have been changed and the installation script is no longer working. DreamHost has moved all of its servers from Debian to Ubuntu. The ionCube loader installation script by Sxi is no longer working. I am not sure if the author has a plan to modify the script and make it work on the new Ubuntu server. Anyway, here is another easy way to install ionCube loader.

Install ionCube Loader using phprc File

These instructions are going to be a bit technical. I am trying to make it simple but you should at least have a basic knowledge of SSH to follow these instructions.

Pre-requirements

1) Domain must be hosted with PHP 5.4.x Fast CGI PHP mode. ┬áTo make sure that you are running PHP 5.4, go to https://panel.dreamhost.com/index.cgi?tree=domain.manage& and check. If it’s running lower version then Edit the domain setting and host it with PHP 5.4.x.

2) The username under which domain is hosted must have SSH enabled. Read article onDreamHost SSH to find out how to enable SSH on the user. If you are on Windows then you must have Putty downloaded on your desktop. So you can connect to the server using SSH through Putty.

Now you can go ahead with instructions. Follow these steps to install ionCube loader on the server.

1) Connect to the server from Putty using SSH.

2) Run the following commands on the server.

cd ~
mkdir ionCube
cd ionCube
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.bz2
tar jxf ioncube_loaders_lin_x86-64.tar.bz2 -C $HOME
rm ioncube_loaders_lin_x86-64.tar.bz2
mkdir -p ~/.php/5.4
cd ~/.php/5.4
echo "zend_extension = /home/dhruvypatel/ioncube/ioncube_loader_lin_5.4.so" > phprc

When you use the last command, make sure to change the username after the /home/. Since I am using my username, I have put dhruvypatel in the path. Change it with your username.

Now the ionCube loader installation is complete. Let’s confirm it.

Check the Installation

If you want to check whether ionCube loader is successfully installed or not then you need to check it using phpinfo file. Just create a file with following content and upload it to the domain where you want to use the ionCube loader.

<?php
phpinfo();
?>

Now run that file in the browser. Under Additional Modules, you should see ionCube Loader line as shown in following image.

DreamHost ionCube Enabled

If you can’t find ionCube Loader information on the phpinfo page then ionCube loader is not enabled yet. Sometimes, you need to restart the apache service to reflect the phprc file changes. To restart the apache service, contact the support team via live chat. Now refresh the phpinfo page and see whether ionCube loader is enabled or not. If you still can’t see the ionCube loader then you have made some mistake in setup.

If you find this instruction complex then let me know and I will help you in setting up ionCube loader on your server.