PDA

View Full Version : local php.ini file not loading



jim.thornton
06-09-2008, 04:50 AM
I have PHP 4.4.8 and PHP 5.2.5 installed on my machine. They both work as expected:

PHP5 - default for all .php files, and also works with .php5 files
PHP4 - loads when you add the AddHandler/AddType directives to .htaccess, or you have .php4 extensions.

My problem is that I want PHP to use the local php.ini file if one is found in the directory that the script is executed. For some reason it is not doing this.

Also... If PHP executes a script under PHP4, it is using the default php.ini file for PHP5 (ie. /usr/local/php5/cgi/php.ini) and not the PHP4 config file.

Can someone please tell me what I've done wrong?

sde
06-18-2008, 01:38 AM
you're right, if you're running in cgi mode, it should look for a php.ini file in the directory you're calling the script from first.

if it doesn't find one there, it looks to an environment variable: PHPRC (you can set that in .htaccess)

then it will look for the path it was compiled with, or the -c argument if you wanted to override it from the script itself.

smtalk
06-18-2008, 05:07 AM
http://help.directadmin.com/item.php?id=183

vovaNux
06-28-2008, 11:58 PM
Try to check phpinfo() for php configuration of each PHP installed.