Bug #79884 [Asn->Csd]: PHP_CONFIG_FILE_PATH is meaningless

From: Date: Thu, 23 Jul 2020 13:44:02 +0000
Subject: Bug #79884 [Asn->Csd]: PHP_CONFIG_FILE_PATH is meaningless
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228198@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79884&edit=1 ID: 79884 Updated by: cmb@php.net Reported by: cmb@php.net Summary: PHP_CONFIG_FILE_PATH is meaningless -Status: Assigned +Status: Closed Type: Bug Package: PHP options/info functions Operating System: Windows PHP Version: 7.3Git-2020-07-22 (Git) Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=15efb96d4ce8003cca1c5fdcda4488c1827065d4 Log: Fix #79884: PHP_CONFIG_FILE_PATH is meaningless Previous Comments: ------------------------------------------------------------------------ [2020-07-22 08:55:39] cmb@php.net The following pull request has been associated: Patch Name: Fix #79884: PHP_CONFIG_FILE_PATH is meaningless On GitHub: https://github.com/php/php-src/pull/5884 Patch: https://github.com/php/php-src/pull/5884.patch ------------------------------------------------------------------------ [2020-07-22 08:25:05] cmb@php.net Related To: Bug #79882 ------------------------------------------------------------------------ [2020-07-22 08:24:11] cmb@php.net 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 this bug report at https://bugs.php.net/bug.php?id=79884&edit=1

« previous php.bugs (#228198) next »