Bug #69436 [Com]: .user.ini in DOCUMENT_ROOT will not be found

From: Date: Tue, 14 Apr 2015 09:38:43 +0000
Subject: Bug #69436 [Com]: .user.ini in DOCUMENT_ROOT will not be found
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192035@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 Comment by: jan dot starke at t-systems dot com Reported by: jan dot starke at t-systems dot com Summary: .user.ini in DOCUMENT_ROOT will not be found Status: Open Type: Bug Package: Directory function related Operating System: any PHP Version: master-Git-2015-04-13 (Git) Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#192035) next »