Re: fopen_wrappers.c DOCUMENT_ROOT .htaccess error
| From: | Scott MacVicar | Date: | Tue, 04 Aug 2009 03:57:10 +0000 |
| Subject: | Re: fopen_wrappers.c DOCUMENT_ROOT .htaccess error | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45210@lists.php.net to get a copy of this message | ||
On 4 Aug 2009, at 04:49, daniel@zoltak.com wrote:
Quoting Scott MacVicar <scott@macvicar.net>:Any chance of a clarification on "doesn't appear to work"? Does it fail to compile or is it killing unicorns :-)This method dosen't appear to work.1. Is it safe to lookup the DOCUMENT_ROOT in fopen_wrappers. If not is there an alternative?Not at the point the function is being executed on a fresh child start PHP hasn't always been fully started by the time it's doing the config merging. None of the SAPI variables have been imported. You might be able to use sapi_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT"))
This was the vulnerability that we were fixing in the first place and no doubt the source of the error.Another solution is to skip doing you check before the SAPI is loaded :-)If we do this then we cannot determine if the error_log is in the DOCUMENT_ROOT.
Do you know the first version it stopped working? 5.2.7 - 5.2.10 is about 15 months worth of bug fixes. Narrowing it down to a particular version would help. ScottYes I am positive it was PHP 5.2.6 - It worked with 5.2.4 and 5.2.5 as well. It would be intresting to understand why it worked in these versions.2. Why was this working in PHP 5.2.6 but now broken in 5.2.1x?Are you sure you were using 5.2.6? We never checked the error_log value until 5.2.4, it's the first version to have it.