php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48831 php -i has different output to php --ini
Submitted: 2009-07-07 11:24 UTC Modified: 2011-06-12 01:47 UTC
From: RQuadling at GMail dot com Assigned: pajoye (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 5.* OS: *
Private report: No CVE-ID: None
 [2009-07-07 11:24 UTC] RQuadling at GMail dot com
Description:
------------
If the environment variable PHP_INI_SCAN_DIR is set, then 

php -i 

outputs the path and any ini files.

If you enter

php --ini

the ini files are correct, but the scan directory is not.

php --ini is only showing the PHP_CONFIG_FILE_SCAN_DIR value rather 
than the php_ini_scanned_path (which may be PHP_CONFIG_FILE_SCAN_DIR 
if there is no PHP_INI_SCAN_DIR envvar).

Patch below

Index: php_cli.c
===================================================================
RCS file: /repository/php-src/sapi/cli/php_cli.c,v
retrieving revision 1.211
diff -u -r1.211 php_cli.c
--- php_cli.c	5 Jun 2009 18:50:10 -0000	1.211
+++ php_cli.c	7 Jul 2009 11:16:14 -0000
@@ -1360,7 +1360,7 @@
 				{
 					zend_printf("Configuration 
File (php.ini) Path: %s\n", PHP_CONFIG_FILE_PATH);
 					zend_printf("Loaded 
Configuration File:         %s\n", php_ini_opened_path ? 
php_ini_opened_path : "(none)");
-					zend_printf("Scan for 
additional .ini files in: %s\n", *PHP_CONFIG_FILE_SCAN_DIR ? 
PHP_CONFIG_FILE_SCAN_DIR : "(none)");
+					zend_printf("Scan for 
additional .ini files in: %s\n", php_ini_scanned_path ? 
php_ini_scanned_path : "(none)");
 					zend_printf("Additional .ini 
files parsed:      %s\n", php_ini_scanned_files ? 
php_ini_scanned_files : "(none)");
 					break;
 				}




Patches

ScanIniDir (last revision 2010-04-12 15:23 UTC by rquadling@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-07 11:28 UTC] rquadling@php.net
Typo: had => has
 [2009-08-24 12:48 UTC] RQuadling at GMail dot com
Missed an PHPAPI extern char *php_ini_scanned_path;
 [2010-04-12 17:23 UTC] rquadling@php.net
The following patch has been added/updated:

Patch Name: ScanIniDir
Revision:   1271085810
URL:        http://bugs.php.net/patch-display.php?bug=48831&patch=ScanIniDir&revision=1271085810
 [2010-09-14 12:36 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=303357
Log: - fix #48831  php -i has different output to php --ini
 [2010-09-14 12:36 UTC] pajoye@php.net
-Status: Assigned +Status: Closed -PHP Version: 5.*, 6CVS (2009-07-07) +PHP Version: 5.*
 [2010-09-14 12:36 UTC] pajoye@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2011-06-09 00:05 UTC] rquadling@php.net
-Status: Closed +Status: Re-Opened -Assigned To: pajoye +Assigned To:
 [2011-06-09 00:05 UTC] rquadling@php.net
The bug is still in effect. The changes made don't actually effect the output. The 
commit made only added a single extern and did not amend the code to display the 
php ini scan dir.

The supplied patch covered all the bases.
 [2011-06-11 04:01 UTC] felipe@php.net
-Status: Re-Opened +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2011-06-11 04:01 UTC] felipe@php.net
The changes in 5_3 were different from trunk.
 [2011-06-12 01:24 UTC] pajoye@php.net
http://lxr.php.net/opengrok/xref/PHP_5_3/sapi/cli/php_cli.c#1365

and

http://lxr.php.net/opengrok/xref/PHP_TRUNK/sapi/cli/php_cli.c#1314

The patch has been applied as it was afaict. Or what are you referring to?
 [2011-06-12 01:27 UTC] felipe@php.net
Oh sorry, I was comparing rev 303357. :)
 [2011-06-12 01:43 UTC] rquadling@php.net
Please look at the patch : http://bugs.php.net/patch-display.php?
bug_id=48831&patch=ScanIniDir&revision=latest

The line to be removed is ...

zend_printf("Scan for additional .ini files in: %s\n", *PHP_CONFIG_FILE_SCAN_DIR 
? PHP_CONFIG_FILE_SCAN_DIR : "(none)");

and should be replaced with ...

zend_printf("Scan for additional .ini files in: %s\n", php_ini_scanned_path  ? 
php_ini_scanned_path : "(none)");


As you've shown in lxr, this has not happened in PHP_5_3

OOI, I've never actually built trunk, only PHP_5_3 (and soon to be using 5.4 
also, just as soon as I work out a way to build both on 1 setup AND support 
testing of them AND having an official build as standard).

What I mean by that is that I only ever tested my patch on 5.3. I was quite new 
to building things and didn't touch trunk.

Thanks for coming back and looking.
 [2011-06-12 01:46 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=312072
Log: - Fix missing change from r303357 (related to bug #48831)
 [2011-06-12 01:47 UTC] felipe@php.net
-Status: Assigned +Status: Closed
 [2011-06-12 01:47 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Yeah, I noticed that was comparing the wrong lines, thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC