Bug #79884 [NEW]: PHP_CONFIG_FILE_PATH is meaningless
| From: | cmb@php.net | Date: | Wed, 22 Jul 2020 08:24:11 +0000 |
| Subject: | Bug #79884 [NEW]: PHP_CONFIG_FILE_PATH is meaningless | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228172@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: Windows
PHP version: 7.3Git-2020-07-22 (Git)
Package: PHP options/info functions
Bug Type: Bug
Bug description:PHP_CONFIG_FILE_PATH is meaningless
Description:
------------
On Windows, PHP_CONFIG_FILE_PATH is determined during *build* time
(using the environment variable SystemRoot, and falling back to an
empty string if that is not set).
However, when constructing the php_ini_search_path during *run*
time, this constant is ignored, and instead the results of
GetWindowsDirectory() and GetSystemWindowsDirectory() are added to
the INI search path[1].
While in the most typical case either is C:\Windows, both may
actually differ; thus, PHP_CONFIG_FILE_PATH must not be set to any
hard-coded value during *build* time.
[1]
<https://github.com/php/php-src/blob/php-7.3.20/main/php_ini.c#L542-L563>
Test script:
---------------
<?php
var_dump(getenv("SystemRoot"), PHP_CONFIG_FILE_PATH);
?>
Expected result:
----------------
string(10) "D:\WINDOWS"
string(10) "D:\WINDOWS"
Actual result:
--------------
string(10) "D:\WINDOWS"
string(10) "C:\WINDOWS"
--
Edit bug report at https://bugs.php.net/bug.php?id=79884&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79884&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79884&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79884&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79884&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79884&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79884&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79884&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79884&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79884&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79884&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79884&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79884&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79884&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79884&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79884&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79884&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79884&r=mysqlcfg