IonCube Loader

From DreamHost

Jump to: navigation, search

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.
Support for these instructions is not available from DreamHost tech support.
Server changes may cause this to break. Be prepared to troubleshoot this yourself if this happens.
We seriously aren't kidding about this. Read the blinky part again.

You may also find useful or helpful information on the official ionCube loader installation page, though it is important to realize that the "run-time Loading Installation" described there will not work on DreamHost, as described there, without considerable modification of the PHP environment if your server is running a version of PHP greater that 5.2.5. This is due to security improvements in these versions of PHP.

As DreamHost servers have been upgraded to 5.2.6 as of this writing, 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.

Installing ionCube Loader on DreamHost

In order to install ionCube Loader on a DreamHost account please make sure you have filled one of the following requirements before continuing:

Additionally, 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();
?>

With one of the above requirements fulfilled and knowledge of which PHP version you're using, you'll now need to download the appropriate Linux (x86 or x86-64) ionCube Loader package onto your DreamHost account from either the main ionCube Download page.

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.
From here, you'll need to login to your DreamHost account via the shell and execute the commands listed below.

cd $HOME/ioncube
tar jxf ioncube_loaders_lin_x86.tar.bz2 -C $HOME
rm ioncube_loaders_lin_x86.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.2.so).
Now 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 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.

External links

Personal tools