php.net |  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: cmb@php.net 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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2020-07-22 08:24 UTC] 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"


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-22 08:55 UTC] 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:55 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-07-23 13:44 UTC] cmb@php.net
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
 [2020-07-23 13:44 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 11:01:22 2020 UTC