Bug #73124 [NEW]: php_ini_scanned_files() not reporting correctly
| From: | john-stevenson at blueyonder dot co dot uk | Date: | Tue, 20 Sep 2016 11:01:19 +0000 |
| Subject: | Bug #73124 [NEW]: php_ini_scanned_files() not reporting correctly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-204146@lists.php.net to get a copy of this message | ||
From: john-stevenson at blueyonder dot co dot uk
Operating system: Windows 10
PHP version: 5.6.26
Package: *Configuration Issues
Bug Type: Bug
Bug description:php_ini_scanned_files() not reporting correctly
Description:
------------
When PHP has not been compiled using the --with-config-file-scan-dir
option, php_ini_scanned_files() does not report additional ini files
that have been scanned via the PHP_INI_SCAN_DIR environment variable .
However the correct information is shown when running php --ini
I realize that this is an edge-case, but PHP_INI_SCAN_DIR is used
regardless of the compile option in php_init_config():
https://github.com/php/php-src/blob/1c295d4a9ac78fcc2f77d6695987598bb7abcb83/main/php_ini.c#L609
Whereas in php_ini_scanned_files() this option is required for the data
to reported (even though the data exists):
https://github.com/php/php-src/blob/fcc6f2df5986bb9615a658cc717b1a92922462d2/ext/standard/info.c#L1388
Test script:
---------------
Using a Windows build (so no --with-config-file-scan-dir) create a file
named "date.ini" somewhere containing the line:
date.timezone = Antarctica/McMurdo
Now run the following:
set PHP_INI_SCAN_DIR=path\to\somewhere
php -r
"var_dump(php_ini_scanned_files());var_dump(ini_get('date.timezone'));"
Expected result:
----------------
Command line code:1:
string(???) "path\to\somewhere\date.ini"
Command line code:1:
string(18) "Antarctica/McMurdo"
Actual result:
--------------
Command line code:1:
bool(false)
Command line code:1:
string(18) "Antarctica/McMurdo"
--
Edit bug report at https://bugs.php.net/bug.php?id=73124&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73124&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73124&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73124&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73124&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73124&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73124&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73124&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73124&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73124&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73124&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73124&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73124&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73124&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73124&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73124&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73124&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73124&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73124&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73124&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73124&r=mysqlcfg