ionCube installation

I would like to share how I finally got it to worked for me with the help of the Support Desk (guys - thanks for the patience) and sXi, who put me on the right track finally.

Many of the DH wiki articles on these matters are outdated as they still refer to previous DH server setup.

In particular refers to php4, now php5 is standard & refers wrongly to ioncube loader package x86_32, whereas DH servers apparently switched to the x64 some time ago (never knew that till yesterday…thanks sXi)

  1. For customization of php, I choose not to do a “custom php installation”, as I for one, being a noobie, feel not able to maintain updates to the php package manually and choose therefore the “custom php.ini”, which still references the DH standard php package and principally still takes advantage of the php updates made by the nice folks of DH.

I could not get the outline method of using a php-wrapper to work - phpinfo.php could not work then. So I adapted the method outline here ( to reflect DH upgrade to php5, which mainly are:

cp /dh/cgi-system/php5.cgi ~/[your website directory]/cgi-bin/php5.cgi (using SSH) plus the correct php5.ini from DH!

Then I added the following to the end of .htaccess in the domain directory, where I use custom php.ini & ioncube loader

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi

Make sure that you correctly name and transfer the .htaccess to domain directory in question (I messed up on that one initially). DH is hiding .htaccess by default, so in SSH you may use ls - la to check whether it is there, most FTP programs provide a switch to access “invisible” files which is also -la

  1. IonCube: First download ioncube_loaders_lin_x86-64.tar.bz2 (again, you would need the …-64 version of loader) directly from Ioncube (do not use the direct link in the wiki article!), then follow the rest the installation instructions (

Apparently the example in that wiki page starting with [soap] is rather that - an example of user who wrote the wiki article.

You need to reference the loader in your (custom php.ini) file as the 1st zend extension like so:

zend_extension="/home/username/domain/(sub-domain - if used)/ioncube/"

Don’t add

In my case I left the two zend extensions that are part of the original php.ini (v5), namely and, which according to phpinfo are loaded without conflict - the wiki says to disable all other zend extensions…

So now I am ready to install the extension that actually requires ioncube

Hope this helps some of you

Thanks sXi - finally everything seems to be working ok - see post below…

Actually, this is not correct, as the page referenced is tailored for PHP5. Note:

[color=#0000CC]" Copy the default php.ini file

cp /etc/[color=#CC0000]php5[/color]/php.ini $HOME/[/color]

and later

[color=#0000CC]exec /dh/cgi-system/[color=#CC0000]php5.cgi[/color] [/color]

& refers wrongly to ioncube loader package x86_32, whereas DH servers apparently switched to the x64 some time ago (never knew that till yesterday…thanks sXi)[/quote]
Once again this is not entirely correct, as that page cautions you to check which version you need, with the lines:

[color=#0000CC]"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 #1 SMP Thu May 15 22:08:43 PDT 2008 x86_64

[color=#CC0000]In this example[/color], the “x86_64” following the time stamp information indicates you would need the “x86-64” version of the ioncube loader package.

[color=#CC0000]This guide will assume you’re installing an “x86” version[/color] of the loader package …[/color]"

Of course, the assumption here, and the point of the caution, was that you need to check which version to use, and use the correct one! :wink:

You make a good point that, while the article goes on to use the x-86 version as an example, the direct link before that explanation is offered is to the x-86 version, and that is confusing (I have changed it - it should only point to the actual page where the downloads are offered, so people will have to check which version is required for their needs)

Maybe with the advent of the recent 64-bit upgrades, and example using the 64 bit tarball would be a good addition to the wiki (anyone can edit!)

At any rate, I am very glad you got it working, and that you have taken the time to share your experience here! :slight_smile:

–DreamHost Tech Support

Good to see everyone is up and running :slight_smile:

Maximum Cash Discount on any plan with MAXCASH

Yes, indeed it is!

–DreamHost Tech Support

Thanks for all the help and advice above, much appreciated.

Well, where to begin! Having spent around 3 days trying to get the above and other solutions to work I decided to start fresh, thereby undoing a lot of the previous attempts first. I went to remove info.php - which I’d been using to test the PHP. Then in my browser, on different IPs, ISPs, browsers, and PCs the file was still there!! Doing some more testing I discovered that files I was uploading, while showing up in FTP and SSH were NOT THERE when browsing on different machines, IPs, ISPs, browsers…
Then after yet another 24hr wait for my question to be answered (6 questions and queries to Dreamhost = 6 working days of waiting, tinkering, changing, sweating…) I hear from Dreamhost that ‘sorry, you may be currently working on two different servers due to a problem in changing over…’ - therefore all of the above work on PHP and Ioncube was effectively for nothing as yet again Dreamhost service was all over the place. That is on top of the several days of down time last week due to the switch apparently to x64 setup.
So, thanks again for all the advice on Ioncube which I will later today have to begin again on my ‘new’ server (if I can 100% be confident that I’m actually working on the right one) and see if I can get anywhere with it all.
However, I may or may not bother as I am in the process of moving this weekend to United Hosting - I’ve surely had quite enough for one year of Dreamhost service being abysmal.

Once again many thanks to those who offered help here on Ioncube, if I decide to go ahead and try the above on Dremahost servers I’ll let you know if the steps were successful.


I’ve done the exact steps as you’ve mentioned. I’ve downloaded the linux loaders x86-64 and have placed them in /home/username/ioncube folder

I then copied php5.cgi and php.ini from respective directories to my

i edited the php.ini file and added the following line in it

I then created file and placed the following lines in it:
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi

Initially, i had messed up something and i was getting 500 internal server error. Now, following this procedure from the scratch has got me rid of that error but the actual purpose of getting the ioncube loaders running is still not achieved. the ioncube helper file still says i need loader

The error.log says this:
[Thu Oct 02 16:04:50 2008] [error] [client] Failed loading /home/username/ioncube/ /home/username/ioncube/ cannot open shared object file: No such file or directory

Whereas i’ve checked that the /home/username/ioncube directory EXISTS and there IS a file in it!

Any help to this would be appreciated.

Hi all,

Just wanted to let you know that the above way worked 100% for me. I too chose not to compile or install my own copy of php, rather just use the php.ini way.

I have got ioncube up and going now.

Just one question, if the version of PHP is upgraded on the server, should i update my php.ini file and add my mod back in there?

Also one more question: does the .htaccess that i setup in the root of the domain dir apply for all directories below it? or do i need the same .htaccess file in all areas that need to have this custom php.ini file in use?

Thanks to the support forum thread as this helped me out.

My actual directory to the path of the file i set was:

The .htaccess file in the folder will apply throughout

Maximum Cash Discount on any plan with MAXCASH

Excellent. thanks for the confirmation.

I’ve done that too and its still not working. Can you please help me as I’m stuck after trying all the options that i know.

I tried many things and it won’t work.

I could not edit.
But just to say, now it’s working.
I used custom php.ini and downloaded linux x86-64 ioncube loader.

Whoah! What a mess! Glad you all got ioncube running, I haven’t yet. I posted what I’ve tried so far here:

I’ve been messing with this for two days now, and I’m finding myself frustrated, because I purchased software that “requires” ionCube…and I have 30 days to test it…and I can’t get the software to work.

…at least not yet. :slight_smile: