Bug #69436 [Opn->Dup]: .user.ini in DOCUMENT_ROOT will not be found

From: Date: Tue, 03 Aug 2021 11:51:23 +0000
Subject: Bug #69436 [Opn->Dup]: .user.ini in DOCUMENT_ROOT will not be found
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235549@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69436&edit=1 ID: 69436 Updated by: cmb@php.net Reported by: jan dot starke at t-systems dot com Summary: .user.ini in DOCUMENT_ROOT will not be found -Status: Open +Status: Duplicate Type: Bug Package: *Configuration Issues -Operating System: any +Operating System: Windows PHP Version: master-Git-2015-04-13 (Git) -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Yeah, you're right, although this is a Windows only issue, and has been reported as bug #79489, which is fixed as of PHP 7.3.19 and 7.4.7, respectively. Closing as duplicate. Previous Comments: ------------------------------------------------------------------------ [2015-04-14 09:38:43] jan dot starke at t-systems dot com it seems that this behaviour occurs because the trailing slash ist removed in sapi_cgi_activate, just before php_cgi_ini_activate_user_config is called: php_cgi_ini_activate_user_config assumes that the string which ptr points to (part of s2) contains at least one slash after ptr: /dir1/dir2/dir3/ ^ ptr --------+ but if the slash is removed, then the while loop is not entered I don't know why the slash is removed, and I have no problem with that. I'd suggest that php_cgi_ini_activate_user_config should not make any assumption about trailing slashes in folder names. ------------------------------------------------------------------------ [2015-04-13 13:19:12] jan dot starke at t-systems dot com Description: ------------ considering the current implementation of php_cgi_ini_activate_user_config in cgi_main.c, .user.ini will never be read if the current working equals DOCUMENT_ROOT: <code> ptr = s2 + start; /* start is the point where doc_root ends! */ /* the following condition will never be true, because ptr points to the last character of the directory name (see above), which is, by implementation, no DEFAULT_SLASH. */ while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) { /*...*/ } </code> Expected result: ---------------- .user.ini will be read, if it is stored in DOCUMENT_ROOT, or in the runtime folder of the application server (i.e. php-cgi), no matter if both folders are identical. Actual result: -------------- If .user.ini is stored in DOCUMENT_ROOT, and your application server has DOCUMENT_ROOT as runtime folder, then .user.ini will not be read. If you change DOCUMENT_ROOT to something invalid, and make the application server run in the folder where .user.ini is stored, then .user.ini will be read. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69436&edit=1

« previous php.bugs (#235549) next »