Quick question - Ioncube install which php.ini to update with Zend installed

shaunchng

Verified User
Joined
Aug 2, 2008
Messages
14
Hey all, I am installing ioncube on my server with Zend already installed, I read on the ioncube site that after installing the .so files in my /usr/local/ dir I will have to update my php.ini file to reflect the install and run:

Code:
zend_extension = /usr/local/lib/php/extensions/ioncube_loader_lin_5.2.so

The thing is that upon phpinfo() I seem to have 2 php.ini files listed (one is said to be loaded)

Code:
Configuration File (php.ini) Path   /usr/local/lib 
Loaded Configuration File  /usr/local/Zend/etc/php.ini

So given that, one is the standard php.ini and another by my current Zend install.

Which php.ini file do I modify to add the additional "zend_extension = /usr/local/lib/php/extensions/ioncube_loader_lin_5.2.so" parameter? only the one loaded? (In zend?), in the default php.ini as stated on the ioncube official instructions or both?

In my /usr/local/lib/php.ini , I have, the following on the last [Zend] Part
Code:
[Zend]
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

In my /usr/local/Zend/etc/php.ini , I have, the following (similar) on the last [Zend] Part
Code:
[Zend]
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
 
The Zend installation deletes /usr/local/lib/php.ini and creates a link from /usr/local/lib/php.ini to /usr/local/Zend/etc/php.ini

It tells you that during the Zend installation.
 
Hi floyd,

Ok, but I do not think it's deleted, but rather inactive? (as it is still there)
My server already have Zend installed, before I took over, so I do not know whether it's deleted upon install, but from what I know, I have php.ini in both these directories.

So All i need to do is the just update the php.ini in the /usr/local/Zend/lib/ directory?
 
How do you know its a file and not a symlink?

If you try to open a symlink it will open the real file. That is the point of the symlink.

The DA File Editor is not going to show you whether its a symlink or not.

So far you have not shown us anything that would prove that there are two different php.ini files.

This will show you whether it is a symlink or not:

Code:
ls -l /usr/local/lib/php.ini
 
install ioncube with Zend optimiser already installed

ah yes, you are right, the file is indeed linked to the one in my Zend folder, I've installed the ioncube .so files and updated the php.ini in the Zend directory.

True enough, viewing the old php.ini has the reflection of the changes to the one in the Zend folder as well, it is indeed linked.

Thanks floyd, that cleared my doubts as a newbie in this area. :)
 
install ioncube with zend installed

For those who are looking to install ioncube with Zend installed, heres alittle install guide for those who can possibly be in my situation with the "2" confusing php.ini files.

For starters, you can choose to put ioncube anywhere, I will be giving it it's own folder in /usr/local/ioncube

Code:
mkdir /usr/local/ioncube/
## now to get the file from their website
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
## please update the above file to relfect your version respectively, this one is for the x86-64 release, same for the tar below as well
tar zfx ioncube_loaders_lin_x86-64.tar.gz
cd ioncube
cp ioncube_loader_lin_5.2.so /usr/local/ioncube/

You can "rm" away all the other junk files you do not need in the folder, all you need is the ioncube_loader_lin_x.x.so where x.x is the version specified in the helper file in the package.

To know what file/release you need run the included ioncube-loader-helper.php in the package (you may need to "cp" it to your www directory).

Head to the file editor in direct admin logged under admin and edit the php.ini file there. Add this to your php.ini above anything or before the [Zend] part
zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so

Restart apache and view your phpinfo() again, it should reflect, the ioncube extension:

Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with the ionCube PHP Loader v3.1.33, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

And you are done!
 
Thank you shaunchng,

It worked like a charm!!!!! On the Ioncube site it says under FAQ's that PHP 5.2.x must be installed in the php.ini the runtime loaders do not work.
 
Thank you shaunchng,

It worked like a charm!!!!! On the Ioncube site it says under FAQ's that PHP 5.2.x must be installed in the php.ini the runtime loaders do not work.

Sure glad to be of help

I have not tired running the loaders at runtime in php5.2.X but since you said so, then I guess installing it using the instructions here will be the only way to get it done till a workaround is found.

From what I know (and if my common sense don't fail me too!:D), including ioncube in the php.ini will run faster as compared to doing it at runtime. I remembered reading a benchmark article once on a webmaster site that runtime script for ioncube takes 30% more execution time than the php.ini option, so whether that claim is refutable, I guess there is already a benefit in place there.
 
Back
Top