|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79884 PHP_CONFIG_FILE_PATH is meaningless
Submitted: 2020-07-22 08:24 UTC Modified: 2020-07-22 08:55 UTC
From: Assigned: cmb (profile)
Status: Closed Package: PHP options/info functions
PHP Version: 7.3Git-2020-07-22 (Git) OS: Windows
Private report: No CVE-ID: None
 [2020-07-22 08:24 UTC]
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] <>

Test script:
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"


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-22 08:55 UTC]
The following pull request has been associated:

Patch Name: Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
On GitHub:
 [2020-07-22 08:55 UTC]
-Assigned To: +Assigned To: cmb
 [2020-07-23 13:44 UTC]
Automatic comment on behalf of
Log: Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
 [2020-07-23 13:44 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 24 14:01:29 2024 UTC