php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30327 --with-config-file-path option name, phpinfo() output mislead users
Submitted: 2004-10-05 06:39 UTC Modified: 2013-10-29 07:03 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: gk at proliberty dot com Assigned: krakjoe (profile)
Status: Closed Package: *General Issues
PHP Version: 5.0.2 OS: Linux ; kernel 2.4.18
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gk at proliberty dot com
New email:
PHP Version: OS:

 

 [2004-10-05 06:39 UTC] gk at proliberty dot com
Description:
------------
Bug #26735 described this problem but was closed as 'bogus' when it is really a valid feature request (bug) which needs to be addressed. Please do not 'bogusify' this request since it could have saved me a lot of time if not closed previously.

Both the configure option ('--with-config-file-path') and the phpinfo() output ('Configuration File (php.ini) Path 	/usr/local/php5/lib/php5.ini') imply that this option refers to a 'file' when in fact it refers only to a directory - the name of the config file can ONLY be 'php.ini'. This fact is completely hidden from the user.

This could be corrected by renaming option to:
'--with-config-file-dir'
And changing phpinfo() output to:
'Configuration File (php.ini) Directory'

Oddly, php tries to read /usr/local/php5/lib/php5.ini/php.ini instead of the file reported by phpinfo(): /usr/local/php5/lib/php5.ini

strace -eopen php -r '' 2>&1 | grep ini
...
open("/usr/local/php5/lib/php5.ini/php.ini", O_RDONLY) = -1 ENOTDIR (Not a directory)


Bug #26735 said the following:

 ... the documentation (specifically ./configure --help) is unclear, as well phpinfo() is unclear as it labels the value supplied with --with-config-file-path as Configuration File (php.ini) Path, and typically Path of a file would include the filename. Request that the flag be renamed --with-config-file-dir and the corrosponding phpinfo() label be changed as well... i suspect that labels is trivial compared to making the programs obey the labels.


Reproduce code:
---------------
./configure \
....
--with-config-file-path=/usr/local/php5/lib/php5.ini;

<?php phpinfo(); ?>

Expected result:
----------------
Configuration File (php.ini) Path 	/usr/local/php5/lib/
...


Actual result:
--------------
Configuration File (php.ini) Path 	/usr/local/php5/lib/php5.ini
...

php5.ini file is NOT read


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-22 17:23 UTC] dominic dot clifton at gr-tech dot net
I totally agree, it's very misleading.

In older versions of php it was also even more confusing that the value changes from a directory to a file in the phpinfo() output once php actually read a file from the directory!

Show a directory in all cases, even when php has read a file.  Show the actual file that was read seperately.

It appears some work on thus bug has been addresses already:

php 5.2.6 shows this:

Configuration File (php.ini) Path => /opt/php5/etc
Loaded Configuration File => /opt/php5/etc/php.ini

however it still needs to be changed.

the configure option and the documentation needs to change from:

--with-config-file-path

to

--with-config-file-dir

then it'll be inline with:

--with-config-file-scan-dir

(feel free to support the current option for legacy reasons)


The php info output should also change from:

Configuration File (php.ini) Path => /opt/php5/etc
Loaded Configuration File => /opt/php5/etc/php.ini
Scan this dir for additional .ini files => /opt/php5/etc/conf.d 

to

Configuration File (php.ini) Directory => /opt/php5/etc
Loaded Configuration File => /opt/php5/etc/php.ini
Scan this dir for additional .ini files => /opt/php5/etc/conf.d
 [2013-10-29 07:01 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: krakjoe
 [2013-10-29 07:03 UTC] krakjoe@php.net
You have just misunderstood the option, there is no need to change anything, which will be the reason the bug was closed in the first place.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jun 02 22:01:27 2025 UTC