Bug #48831 [PATCH]: php -i has different output to php --ini

[email protected] ("[email protected]") Mon, 12 Apr 2010 17:23:30 +0200 (CEST)
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=48831&edit=1

 ID:               48831
 Patch added by:   [email protected]
 Reported by:      RQuadling at GMail dot com
 Summary:          php -i has different output to php --ini
 Status:           Assigned
 Type:             Bug
 Package:          CGI related
 Operating System: *
 PHP Version:      5.*, 6CVS (2009-07-07)
 Assigned To:      pajoye

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2009-08-24 12:48:57] RQuadling at GMail dot com

Missed an PHPAPI extern char *php_ini_scanned_path;

------------------------------------------------------------------------
[2009-07-07 11:28:46] [email protected]

Typo: had => has

------------------------------------------------------------------------
[2009-07-07 11:24:31] 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;
 				}





------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=48831&edit=1