How to Enable Ioncube Support For The Entire Server

By | January 29, 2010

PHP code protection is widely used today. As most servers come with Zend installed, I will tell you how to install another code protection library named Ioncube. If you’re a server administrator, I would suggest you to install this library on server level, as it might be used by many users of your server.

First of all, we need to download the Ioncube package. Just choose your operating system and download an archive to your place. Then you need to extract it.

tar -xzvf ioncube_loaders_lin_x86.tar.gz

I would suggest you to copy extracted files to a safe location so you could point to it when adding support lines to php.ini.

It will be much easier if ioncube loader helper page is accessible from the web, just like here: http://www.lampdocs.com/blog/ioncube/ioncube-loader-helper.php?page=install-assistant . Helper will detect the place where your php.ini is located and will suggest the correct path. If you don’t have web access to helper page, you’re welcome to follow my post finding php.ini file location.

To install the Loader in your php.ini file, edit or create php.ini file by the path specified by loader and add the following line before any other zend_extension lines:

zend_extension = /
/ioncube_loader_lin_5.2.so

where /
/ is where you’ve installed the loader, e.g. /usr/local/ioncube/. Make sure this line is added before any other zend_extension lines, as you might have troubles starting Apache. Here is how it looks on my server:

[Zend]
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.2.so
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
zend_optimizer.version=3.3.3

zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

After that you must restart apache to activate your changes. You should not experience problems starting it, and your ioncube installation should be ready to use. If not, you’re welcome to ask me here. :)