ionCube installation

ionCube installation

Posted by: amnesia
Posted on: 2008-08-24 00:05:00

Hey there everyone,

I'm attempting to use a script by 68classifieds which requires ioncube. However at the moment I do not know how to install it.

I'd gladly offer what limited funds I have if someone could help me to install it and explain to me how to update it in the future.


Many thanks in advance.


Re: ionCube installation

Posted by: sXi
Posted on: 2008-08-24 12:31:00

Sure, I've installed ioncube for a few people here who were a little overwhelmed with the shell. Basically you install a customised PHP, upload the correct ioncube loader, and call it from your custom php.ini

Updating is a simple matter of overwriting the loader with a newer version as they become available.

The process isn't tricky at all. Takes about an hour to install, 2 minutes to update.


Re: ionCube installation

Posted by: amnesia
Posted on: 2008-08-25 01:21:00

that's perfect! I've sent you a pm :)

Re: ionCube installation

Posted by: sXi
Posted on: 2008-08-25 02:55:00

I didn't receive one frown


Re: ionCube installation

Posted by: amnesia
Posted on: 2008-09-10 05:02:00

hey there guys,
After sxi kindly helped out, it seems that I have another issue.

Now the folder 'classifieds' which is why I needed the ioncube installation doesn't work... it's strange..

see www.iloveqatar.net/classifieds

Can someone help?

Re: ionCube installation

Posted by: nkockat
Posted on: 2008-09-10 13:07:00

hi can someone explain step by step ioncube installation?
very urgent

Re: ionCube installation

Posted by: johnadria
Posted on: 2008-09-15 11:59:00

I used this description from the dreamhost wiki very complete and accurate.

http://wiki.dreamhost.com/IonCube_Loader

One small thing is that you have to modify some of the commands to refer to your home directory - so you can't just copy and paste into a command line.



Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-19 04:39:00

Hi amnesia, sorry I wasn't around to reply to this when you posted - I was afk.

Did you get the 'missing directory' problem resolved?


Re: ionCube installation

Posted by: CHR
Posted on: 2008-09-23 23:32:00

would you please share how to reference the "home" directory - I am trying what I can since three days and cant figure our which path to use

Thks in advance

Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-23 23:46:00

$HOME


Re: ionCube installation

Posted by: CHR
Posted on: 2008-09-24 00:07:00

edit relevant line in my (custom) php.ini as such:
zend_extension="$HOME/ioncube/ioncube_loader_lin_5.2.so"

still get not-working-correctly" error under "mydomain"/ioncube-loader-helper.php

Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-24 00:45:00

My apologies, I thought you meant within a script.

PHP.ini references should be full links beginning with a forward slash, such as:

zend_extension="/home/user/path/to/loader.so"


Re: ionCube installation

Posted by: CHR
Posted on: 2008-09-24 00:57:00

thanks sXi for your prompt reply....

I am at best a novice as far as php is concerned, so if I may...

do i actually have exactly type "/home/DH server name/my user name/main domain/sub domain /ioncube/..." basically replicating the complete path as shown under phpinfo for loaded configuration file

or

as everything is located in a sub-domain of main domain (custom php is also referenced within the sub-domain), I can just commence with =/subdomain/ioncube (which unfortunately does not seem to work for me)

Thks again

Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-24 01:06:00

The "/.server/" part is superfluous and not required.

From your description, it would appear your path would be something like:

/home/username/sub.domain.com/ioncube/loader.so



Re: ionCube installation

Posted by: CHR
Posted on: 2008-09-24 01:41:00

sorry, doesn't work either.... Last question(s) before I can the add-on that actually requires ioncube:
- what CHMOD should loader.so have, mine is presently 644
- IonCube wiki articles requires add line of [suhosin]
extension="suhosin.so" - where does that file come from as it is not in the ioncube subfolder or part of loader.so...
Thks for your help!

Re: ionCube installation

Posted by: adrianmh
Posted on: 2008-09-24 02:18:00

Hi - 644 should be right. It is also important to have the latest x86-64 loaders due to Dreamhost recent upgrade to x64 - the reason all of our Ioncube sites are now broken.
We are having incredible problems trying to solve these issues - I don't see why Dreamhost can't just enable Ioncube centrally, it is required by many CMS solutions and other installs these days. Instead we are struggling for days now with these issues.
I am now currently trying to go step-by-step with the custom PHP install, over and above already having custom php.ini and php.cgi previously - which was working fine before - updating the ioncube loaders and the php.cgi did not solve the problem.
There are so many things to make sure are just right, otherwise looks like it will break.
It would be *highly* useful if somebody can put some simple step-by-step instructions here for doing either a custom PHP5 install on one of my domains, or how to do the custom php.ini + php.cgi file solution - that would help many of us now and in the future. The Dreamhost instructions via the wiki are not clear at all.
Good luck to all who are suffering these issues!
Adrian

Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-24 03:19:00

In reply to:

sorry, doesn't work either.... Last question(s) before I can the add-on that actually requires ioncube:
- what CHMOD should loader.so have, mine is presently 644
- IonCube wiki articles requires add line of [suhosin]
extension="suhosin.so" - where does that file come from as it is not in the ioncube subfolder or part of loader.so...


chmod 644 is okay.

The part in the Wiki you're referring to looks like the author intended the information to appear as a 'screenshot' of what you would see when editing a PHP.ini file. The only part you need to worry about is:

[ioncube]
zend_extension="/../../loader.so"




Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-24 03:28:00

I think the argument against blanket-enabling something that obfuscates data from the end user is an easy win. Devices like ioncube have been, and continue to be, used for malicious purposes. If a user hasn't the ability to configure the environment to enable the functionality of obfuscation scripts I think it's logical that they they shouldn't be running scripts that "require" it. It's really in our best interests that ioncube isn't provided in our default environment.

The majority of "issues" faced by many users (99.9%) are due mostly to them not gathering the information that they require before embarking on their proposed environment change. For example, those who have taken the time to understand the necessities have little to no trouble installing PHP, ioncube, freetds, and all the other "nigglewares" that have popped up here on the forum over the past week.

In regard to ioncube specifically, the installation is earmarked as an "Advanced" procedure in the Wiki, however in actuality the process is simple enough for someone with a rudimentary understanding of shell commands to accomplish manually without too much hassle -- provided they have a fundamental awareness of what they're doing in the first place.


Re: ionCube installation

Posted by: adrianmh
Posted on: 2008-09-24 08:57:00

Yes, then it would be better to have all the software vendors out there who 'require' Ioncube to change the way to implement their wares?

Trouble is that a lot of applications, CMS's and other tools are suggesting they 'require' Ioncube. Therefore it is logical that in trying to offer our customers and users the best sites possible we'd probably want to push ahead with whatever it takes to allow them to do so - ultimately offering the user a good experience, while at the same time not getting bogged down in spending development time over 'niggleware' as it's been put. I'd much rather concentrate on the user than be lost in pointless exercises in backtracking, mending, tinkering, repairing, fixing - what we'd like are elegant and user friendly ways of doing things.

Sure, once I find my way through the maze of the 'simple' task of switching on Ioncube I'll think it is easy. What would be better would be some clear and understandable instructions and ideas on how to do it. What we've got is an area that needs some collaboration and help...

So, it would be great to see some cool answers to the following:

1. Having already installed custom PHP as per this instruction:
http://wiki.dreamhost.com/Installing_PHP5 (to the letter)
we now have a info.php (btw phpinfo.php will not work for some reason on my domain...) showing my php.ini file here: /mnt/local/home/USER/www.domain.com/cgi-bin/php.ini

instead of here: /php5/etc/php5/www.domain.com (as per the instructions)

- then we add this to the .htaccess :
Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>

Action application/x-httpd-php5 /cgi-bin/php5.cgi
AddType application/x-httpd-php5 .php5

Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-24 10:24:00

In reply to:

Yes, then it would be better to have all the software vendors out there who 'require' Ioncube to change the way to implement their wares?


That's exactly right.

In reply to:

Trouble is that a lot of applications, CMS's and other tools are suggesting they 'require' Ioncube.


No software 'requires' ioncube. The coder made a judgement call to obfuscate data. Usually this is done to obscure methodology (for whatever reason). Some scripts use it to protect copywritten content, others use it to hide the fact they've ripped off other's code, and the worst hide their evilness inside the encrypted bits.

In reply to:

Trouble is that a lot of applications...are elegant and user friendly...


They're the ones that don't "require" ioncube, fopen, register globals, etc.


In reply to:

1. Having already installed custom PHP as per this instruction:
http://wiki.dreamhost.com/Installing_PHP5 (to the letter)


There are multiple solutions on the page you linked, which one did you attempt?

In reply to:

we now have a info.php (btw phpinfo.php will not work for some reason on my domain...)


Notepad them. What's the difference between the info.php and phpinfo.php you allude to?

In reply to:

If the loaded configuration file is here...


Perhaps PHP is being directed to an incorrect location.
I couldn't make a call on that without clearer information.

In reply to:

Does this whole exercise require a server reboot (as per instructions)


No reboot is required as DH uses the better approach. (See ioncube site re: runtime).
To which instructions regarding a reboot are you referring?

In reply to:

... how can we start from scratch and make sure we get this right?


*Very Carefully* delete all files the installation(s) created within root and domain.com, including directories, with the command rm -rf dirname. You can ascertain the directories & files created by reading the script(s) you used. Most scripts appear to rely on an etc folder, so be sure there aren't any files in there that *don't* pertain to your customised PHP before removing it from root. You wouldn't want to inadvertently break something else whilst endeavouring to fix this (something I've learned the hard way - a few times lol).


Re: ionCube installation

Posted by: adrianmh
Posted on: 2008-09-24 11:27:00

In reply to:

Re: ionCube installation

Posted by: CHR
Posted on: 2008-09-24 19:27:00

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 http://wiki.dreamhost.com/PHP.ini refers to php4, now php5 is standard & http://wiki.dreamhost.com/IonCube_Loader 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 (http://discussion.dreamhost.com/showflat.pl?Board=forum_troubleshooting&Number=110517&page=0&view=collapsed&sb=5&o=14&vc=1) 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

2. 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 (http://wiki.dreamhost.com/IonCube_Loader)

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/ioncube_loader_lin_5.2.so"

Don't add suhosin.so

In my case I left the two zend extensions that are part of the original php.ini (v5), namely ZendExtensionManager.so and ZendOptimizer.so, 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

Re: ionCube installation

Posted by: CHR
Posted on: 2008-09-24 19:33:00

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

Re: ionCube installation

Posted by: rlparker
Posted on: 2008-09-25 01:15:00

In reply to:

In particular http://wiki.dreamhost.com/PHP.ini refers to php4, now php5 is standard


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

" Copy the default php.ini file

cp /etc/php5/php.ini $HOME/example.com/cgi-bin/php.ini


and later

exec /dh/cgi-system/php5.cgi

In reply to:


& http://wiki.dreamhost.com/IonCube_Loader 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)


Once again this is not entirely correct, as that page cautions you to *check* which version you need, with the lines:

"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 ...
"

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! smile

--rlparker
--DreamHost Tech Support

Re: ionCube installation

Posted by: sXi
Posted on: 2008-09-25 08:23:00

Good to see everyone is up and running smile


Re: ionCube installation

Posted by: rlparker
Posted on: 2008-09-25 08:36:00

In reply to:

Good to see everyone is up and running smile


Yes, indeed it is!

--rlparker
--DreamHost Tech Support

Re: ionCube installation

Posted by: adrianmh
Posted on: 2008-09-25 19:48:00

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.

Bye!
Adrian

Re: ionCube installation

Posted by: haaynum
Posted on: 2008-10-02 16:12:00

hello,
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 domain.com/cgi-bin

i edited the php.ini file and added the following line in it
zend_extension="/home/username/ioncube/ioncube_loader_5.2.so"

I then created domain.com/.htaccess 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 116.71.179.234] Failed loading /home/username/ioncube/ioncube_loader_5.2.so: /home/username/ioncube/ioncube_loader_5.2.so: 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 ioncube_loader_5.2.so in it!

Any help to this would be appreciated.

Re: ionCube installation

Posted by: churchi
Posted on: 2008-10-02 17:42:00

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.

Edited by churchi on 10/02/08 05:58 PM (server time).

Re: ionCube installation

Posted by: churchi
Posted on: 2008-10-02 17:56:00

My actual directory to the path of the file i set was:
/home/.hincmar/username/<website>/ioncube/



Re: ionCube installation

Posted by: sXi
Posted on: 2008-10-02 18:51:00

The .htaccess file in the domain.com folder will apply throughout domain.com


Re: ionCube installation

Posted by: churchi
Posted on: 2008-10-02 21:50:00

Excellent. thanks for the confirmation.

Re: ionCube installation

Posted by: haaynum
Posted on: 2008-10-03 13:39:00

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.

Re: ionCube installation

Posted by: CajuCLC
Posted on: 2008-10-09 03:23:00

I tried many things and it won't work.

Re: ionCube installation

Posted by: CajuCLC
Posted on: 2008-10-10 19:09:00

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

Re: ionCube installation

Posted by: dainis
Posted on: 2008-10-27 05:04:00

Whoah! What a mess! Glad you all got ioncube running, I haven't yet. I posted what I've tried so far here: http://discussion.dreamhost.com/showflat.pl?Cat=0&Board=3rdparty&Number=112160&page=0&view=&sb=&part=1&vc=1&o=

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. :-)

Ugh!
Dainis

Tags: many thanksthanks in advance