Re: fopen_wrappers.c DOCUMENT_ROOT .htaccess error
| From: | daniel at zoltak dot com | Date: | Tue, 04 Aug 2009 03:49:33 +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 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45209@lists.php.net to get a copy of this message | ||
Quoting Scott MacVicar <scott@macvicar.net>:
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"))
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.
Yes 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.