faqts : Computers : Programming : Languages : PHP : Installation and Setup : Configure

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

42 of 67 people (63%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

Why is my configuration file (php.ini) ignored, although I specified its filename with the configure option --with-config-file-path?
Why is my configuration file (php.ini) ignored, although its filename is shown in phpinfo()?

Jun 1st, 2004 06:22
Michael Haeusler, http://www.php.net/manual/en/faq.installation.php#faq.installation.phpini


At startup PHP searches for the configuration file (php.ini) within the
*directory*, which is specified with the configure option
--with-config-file-path (the default value for this is PREFIX/lib, which
is /usr/lib or /usr/local/lib on most systems).

Giving the full path including the filename will *not* work
--with-config-file-path=/usr/local/lib/php.ini

So you have to specify only the *directory*:
--with-config-file-path=/usr/local/lib


This is can be easily overlooked, because the config-file-path is
displayed in two different ways, when you make a call to phpinfo():
a) If the configuration file was *not* found at startup, the section
"Configuration File (php.ini) Path" shows the *directory*, which was
unsuccessfully searched for the file.
b) If the configuration file *was* found at startup, the section
"Configuration File (php.ini) Path" shows the configuration *file*,
which was used.

So if you have inadvertently specified
--with-config-file-path=/usr/local/lib/php.ini, this would be used as a
directory. Of coure, no configuration file can be found at this
"directory". So, no configuration file is used, although
"/usr/local/lib/php.ini" is shown at phpinfo().