Bug #80113 [NEW]: .user.ini may not be applied in subdirectories if CONTEXT_DOCUMENT_ROOT is set

From: Date: Wed, 16 Sep 2020 21:09:01 +0000
Subject: Bug #80113 [NEW]: .user.ini may not be applied in subdirectories if CONTEXT_DOCUMENT_ROOT is set
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229031@lists.php.net to get a copy of this message
From: mattr at wordfence dot com Operating system: Linux PHP version: 8.0.0beta3 Package: CGI/CLI related Bug Type: Bug Bug description:.user.ini may not be applied in subdirectories if CONTEXT_DOCUMENT_ROOT is set Description: ------------ The .user.ini file is no longer applied in subdirectories, when Apache is configured to serve PHP via CGI with configuration like this: ScriptAlias /local-bin /usr/local/bin AddHandler application/x-httpd-php-8-0 .php Action application/x-httpd-php-8-0 /local-bin/php-cgi As far as I can tell, this is caused by the new handling of CONTEXT_DOCUMENT_ROOT in sapi_cgi_activate() in sapi/cgi/cgi_main.c. Using phpinfo, I see that CONTEXT_DOCUMENT_ROOT is not where the php files are located: CONTEXT_DOCUMENT_ROOT: /usr/local/bin DOCUMENT_ROOT: /home/user/public_html When php_cgi_ini_activate_user_config() checks if the script is inside the document root, it is using the value from CONTEXT_DOCUMENT_ROOT, which doesn't match -- so it is no longer looking in parent directories for .user.ini files. -- Edit bug report at https://bugs.php.net/bug.php?id=80113&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80113&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80113&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80113&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80113&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80113&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80113&r=support Expected behavior: https://bugs.php.net/fix.php?id=80113&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80113&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80113&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80113&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80113&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80113&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80113&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80113&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80113&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80113&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80113&r=mysqlcfg

« previous php.bugs (#229031) next »