IonCube Loader
From DreamHost
ionCube Loader is a PHP extension that works to decode PHP scripts previously encoded by the ionCube PHP Encoder package.
Contents |
Installation Guide & Resources
The following information is provided as a guide for installing the ionCube loader needed to run PHP files encoded with ionCube on DreamHost servers.
| The instructions provided in this article or section are considered advanced. You are expected to be knowledgeable in the UNIX shell. |
In order to install ionCube Loader on a DreamHost account please make sure you have filled one of the following requirements before continuing, listed from easiest to hardest:
- PHP 5.3 and above, with phprc file, or
- a Custom PHP.ini install, or
- a Custom PHP install.
You'll need to know which version of PHP your DreamHost account is using. You can easily do this by creating a file named phpinfo.php in your webspace and adding the following to it:
<?php phpinfo(); ?>
You can tell what version of the ionCube loader package for Linux you will need to use by inspecting the first section of the output of the phpinfo.php program you just created, and looking at the "System" description section. For example, consider the following phpinfo() output:
System Linux bugsy 2.6.24.6-p4-modules-peon-grsec #1 SMP Thu May 15 22:08:43 PDT 2008 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.
This guide will assume you're installing an "x86" version of the loader package, and that you are installing ionCube into /home/username/ioncube. It will also assume you've downloaded the bz2 (bzip) archive into this directory, as follows:
Download the appropriate Linux (x86 or x86-64) ionCube Loader package onto your DreamHost account from the main ionCube Loaders download page. Copy the link from your browser and use wget in the DreamHost
shell and extract them:
cd ~ mkdir ioncube cd ioncube wget http://downloads2.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
You should now have several files in your /home/username/ioncube directory.
Please take note of the PHP version in these files: ioncube_loader_lin_<php version>.so (ie. ioncube_loader_lin_5.3.so).
Installing ionCube Loader on Dreamhost with PHP 5.3+ (easy)
If you have configured your fully hosted domain with for PHP 5.3+ and FastCGI, installation is very easy. If you want to upgrade to PHP 5.3+ log into the panel at https://panel.dreamhost.com/index.cgi?tree=domain.manage& and change your domain to use PHP 5.3, preferably with FastCGI.
After you have confirmed that you have PHP 5.3, make a custom phprc file:
mkdir ~/.php mkdir ~/.php/5.3 cd ~/.php/5.3 nano phprc
Add the following directive in the phprc file, replacing username with your shell username:
zend_extension = /home/username/ioncube/ioncube_loader_lin_5.3.so
Make sure that the directive is on only one line, and the first line, in the phprc file. (My attempt defaulted to splitting the line at the equal sign. The loader would not recognize the command.)
This completes the installation. To test it, copy the loader-wizard.php file from the ioncube directory to a public place in one of your web domain directories, and load it in your browser. Answer the questions about "shared hosting" and it should successfully report that ionCube was installed. Then remove the loader-wizard.php file for security reasons.
If you have problems, check the ionCube Forum.
Installing ionCube Loader on DreamHost with PHP 5.2.x or earlier
These instructions only address the installation the ionCube loader using the "Manual Installation in the php.ini File" method.
Note to advanced users:
This is not to say that you may not be able to install the ionCube loader using the run-time loading method and a customized PHP environment (requires custom PHP installation, the loader installed in the extensions directory, and encoded PHP files must be encoded with an enhanced preamble), but this installation guide does not address that process. Further information concerning run-time loading under PHP version 5.2.5, or greater can be found in posts on the ionCube Support Forum.
Installing the ionCube loader using the php.ini file method provides improved performance over the run-time installation method (according to the ionCube FAQ), is much more easily installed in the DreamHost environment than the run-time installation method, and does not require enhanced preambles in the encoded files. For these reasons, it is strongly recommended that you use the php.ini method described below if you want to run ionCube encoded PHP files on DreamHost.
With PHP 5.2.x, modify your php.ini file, using any text editor, so that it points to the proper ionCube loader extension. You 'must' add this modification 'before' any existing zend extensions listed in the php.ini file. An example of what you'll need to modify your php.ini file with is provided below:
[soap] soap.wsdl_cache_enabled=1 soap.wsdl_cache_dir="/home/username/tmp" soap.wsdl_cache_ttl=86400 [ioncube] zend_extension="/home/username/ioncube/ioncube_loader_lin_5.2.so" [suhosin] extension="suhosin.so"
If you see any other lines in php.ini that say zend_extension=, then you must place a # in front of those lines. If you get an Internal Service Error, then you most likely have not commented out the old zend extensions.
You should now have a fully functional ionCube Loader extension installed. To test and make sure the extension is working for your domain, move the ioncube-encoded-file.php and ioncube-loader-helper.php into your public web directory somewhere (ie. /home/username/mydomain.tld) and open the ioncube-loader-helper.php file from a web browser:
http://mydomain.tld/ioncube-loader-helper.php
You can also execute the phpinfo.php file you created earlier to see if it now lists the ionCube Loader extension:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.1, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
with the ionCube PHP Loader v3.1.31, Copyright (c) 2002-2007, by ionCube Ltd.
with Suhosin v0.9.18, Copyright (c) 2002-2006, by Hardened-PHP Project
Automated ionCube Loader for PHP 5.2 and earlier versions installation with dh-phpion.php
If you can't get it to work you can try to use the script dh-phpion.php that can be found here. Just upload dh-phpion.php into your domain's folder (eg. http://mydomain.com/dh-phpion.php) and open it in a browser and it will do all the work for you.