local php.ini file not loading

jim.thornton

Verified User
Joined
Jan 1, 2008
Messages
334
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?
 
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.
 
Back
Top