Bug #79884 [PATCH]: PHP_CONFIG_FILE_PATH is meaningless

From: Date: Wed, 22 Jul 2020 08:55:39 +0000
Subject: Bug #79884 [PATCH]: PHP_CONFIG_FILE_PATH is meaningless
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228173@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 Patch added by: cmb@php.net Reported by: cmb@php.net Summary: PHP_CONFIG_FILE_PATH is meaningless Status: Open Type: Bug Package: PHP options/info functions Operating System: Windows PHP Version: 7.3Git-2020-07-22 (Git) Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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 (#228173) next »