Multiple PHP running ?

I have finally traced down why initially my new Dual Xeon 3.0 with 2GB Ram server was MUCH slower than my P4 2.4 with 2GB ram. There was multiple versions of PHP running. Or more specifically when I did

php -v

in shell, it would show PHP 4.3.10 ( Cli running ), however, doing a

php -i |grep ini

Showed that is was running from different ini files.

locate *.ini |grep php

/home/interworx/etc/php-cli.ini
/home/interworx/etc/php.ini
/usr/local/Zend/etc/php.ini
/usr/src/redhat/SOURCES/php-cli.ini
/usr/src/redhat/SOURCES/php.ini
/usr/src/php-4.3.10/pear/tests/php.ini
/usr/src/ZendOptimizer-2.5.7-linux-glibc21-i386/zui_files/php.ini
/usr/src/ZendOptimizer-2.5.7-linux-glibc21-i386/zui_files/_etc_php.ini
/etc/php-cli.ini
/etc/php.ini
/etc/php.d/mysql.ini
/etc/php.d/imap.ini
/etc/php.d/domxml.ini
/etc/php.d/ldap.ini
/etc/php.d/odbc.ini
/etc/php.d/pgsql.ini
/etc/php.d/snmp.ini
/etc/php.d/xmlrpc.ini

BOLD ones were being used in my case at random. And note I’m doing this from the shell. The webserver showed the EXACT same problem. It doesn’t matter what Virtual host we put it in - it sometimes shows one, and others the others.

I would like to know if this is normal and if people do get different PHP.ini’s being used all the time. To stop this, I’ve backed up and then over wrote one copy of my ini file with all the others. However, I’m just wondering if this is a stop gap measure and InterWorx will simply overwrite it when it updates it self.

Does anyone else get different ini’s being executed ?

Hello,

Apparently you’ve installed Zend optimizer.

If I remember well zend optimiser duplicate your existing /etc/php.ini file in /usr/local/Zend/etc/php.ini and add at the end of this file

[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

then it created a symlink from /usr/local/Zend/etc/php.ini to /etc/php.ini

You may see the symlink with a simple

ls -l /etc/php.ini

So it is absolutly normal that there is few php.ini.

Also you may check which one is used by checking the phpinfo()

Create a php file with only phpinfo();

You should see something like this

Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini

and

additional .ini files parsed /etc/php.d/imap.ini, /etc/php.d/mysql.ini

also it should tell you than Zend optimiser is running. Always in phpinfo()

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies with Zend Extension Manager v1.0.6, Copyright © 2003-2004, by Zend Technologies with Zend Optimizer v2.5.7, Copyright © 1998-2004, by Zend Technologies

So normally with a

php -v

you should see something like this (replace 4.3.9 with your php version)

PHP 4.3.9 (cgi) (built: Sep 29 2004 19:33:06)
Copyright © 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.6, Copyright © 2003-2004, by Zend Technologies
with Zend Optimizer v2.5.7, Copyright © 1998-2004, by Zend Technologies

and with

php -i |grep ini

you should see

<tr><td class=“e”>Configuration File (php.ini) Path </td><td class=“v”>/usr/local/Zend/etc/php.ini </td></tr>
<tr><td class=“e”>Scan this dir for additional .ini files </td><td class=“v”>/etc/php.d </td></tr>
<tr><td class=“e”>additional .ini files parsed </td><td class=“v”>/etc/php.d/imap.ini,
/etc/php.d/mysql.ini
<tr><td class=“e”>Supported handlers </td><td class=“v”>gdbm cdb cdb_make db4 inifile flatfile </td></tr>

that seems to be normal

So check that /etc/php.ini is a symlink from /usr/local/Zend/etc/php.ini

If it is, you are running only one php version :slight_smile:

I would like to know if this is normal and if people do get different PHP.ini’s being used all the time

so it is depending of what you find about the symlink
If there is one, it is absolutly normal

Hope this will help

Pascal

The thing is that I didn’t. I had a little problem getting around the system. I tried the guide on how to upgrade PHP on the machine. But couldn’t. Well - I just didn’t realise there was another extra step of me having to install it :stuck_out_tongue: Chris was very nice and pointed it out later. :slight_smile:

I didn’t install the Zend optimise. Anyway. At the moment, I’ve set immutable on the files, and I’ve added the settings I wanted to seperately off the files. It’s getting included. So it’s all good. :slight_smile:

I didn’t install the Zend optimise.

Erfff, very strange. You have zend optimiser installed

/usr/local/Zend/etc/php.ini
/usr/src/ZendOptimizer-2.5.7-linux-glibc21-i386/zui_files/php.ini
/usr/src/ZendOptimizer-2.5.7-linux-glibc21-i386/zui_files/_etc_php.ini

Anyway…

Well - I just didn’t realise there was another extra step of me having to install it :stuck_out_tongue: Chris was very nice and pointed it out later.

haha, interworx staff are the best :slight_smile:
For my personnal info, Which extra steps ?

So it’s all good.

cool

Pascal

I just didn’t realise that we were building the RPMs and that I needed to install them. I thought they were building and installing them :stuck_out_tongue: << was not paying attention ^.^