Bug #64138 [Opn->Fbk]: Setting error_log from .htaccess can leak between sites
| From: | cmb@php.net | Date: | Wed, 11 Aug 2021 11:50:55 +0000 |
| Subject: | Bug #64138 [Opn->Fbk]: Setting error_log from .htaccess can leak between sites | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235758@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64138&edit=1
ID: 64138
Updated by: cmb@php.net
Reported by: php at nearlyfreespeech dot net
Summary: Setting error_log from .htaccess can leak between
sites
-Status: Open
+Status: Feedback
Type: Bug
Package: Apache2 related
Operating System: Any
PHP Version: 5.3.21
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Does this still happen to you with any of the actively supported
PHP versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2013-02-03 21:05:47] php at nearlyfreespeech dot net
Description:
------------
Using mod_php5 under Apache 2.2.x, if the PHP error_log value is set from
.htaccess in two separate virtual hosts then under at least some
conditions, the setting leaks between the virtual hosts.
For example, if an Apache server is configured with two virtual hosts, site1 and
site2, and site1 has an .htaccess file in its document root containing:
php_value error_log /sites/site1/logs/php_errors.log
And site2 has an .htaccess file in its document root containing:
php_value error_log /sites/site2/logs/php_errors.log
Then under at least some conditions, site2 (uid 10002) will attempt to log
errors to site1's (uid 10001) specified file. If safe_mode is enabled, this
will fail, causing the following to be written to site1's file:
[Sun Feb 03 12:00:00 2013] [error] [client 10.20.40.80] PHP Warning: Unknown:
SAFE MODE Restriction in effect. The script whose uid/gid is 10002/10002 is not
allowed to access /sites/site1/logs/php_errors.log owned by uid/gid 10001/10001
in Unknown on line 0
Note this error is formatted by *Apache* appearing in the *PHP* error log. If
it were coming straight from PHP, it would be in the format:
[03-Feb-2013 12:00:00 UTC] PHP Warning: Unknown:
SAFE MODE Restriction in effect. The script whose uid/gid is 10002/10002 is not
allowed to access /sites/site1/logs/php_errors.log owned by uid/gid 10001/10001
in Unknown on line 0
That may help narrow down where the problem is, since it is infuriatingly
intermittent.
Expected result:
----------------
Errors from each site should only appear in that site's specified error_log file.
Actual result:
--------------
Errors are occasionally written to the wrong site's log file.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64138&edit=1