#48793 [Com]: Setting error_log in php.ini causes redirection
| From: | ninzya at inbox dot lv | Date: | Sat, 04 Jul 2009 20:02:23 +0000 |
| Subject: | #48793 [Com]: Setting error_log in php.ini causes redirection | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-139257@lists.php.net to get a copy of this message | ||
ID: 48793
Comment by: ninzya at inbox dot lv
Reported By: memoimyself at yahoo dot com dot br
Status: Open
Bug Type: Unknown/Other Function
Operating System: WinXP SP3
PHP Version: 5.3.0
New Comment:
Is your apache server on 8080 port?
Previous Comments:
------------------------------------------------------------------------
[2009-07-03 18:43:47] memoimyself at yahoo dot com dot br
Description:
------------
Set-up: WinXP SP3, PHP 5.3.0, Apache 2.2.11
This is a truly bizarre problem, but I've done a lot of testing and do
believe it's a bug.
A few days ago I updated my test server to PHP 5.3.0. After doing that,
even though Apache had not been touched in any way, all URLs containing
'localhost' pointing to PHP files (e.g. 'http://localhost/whatever.php')
started being redirected to 'www.localhost.com' (e.g.
'http://www.localhost.com/whatever.php').
At first it didn't even occur to me that the problem could have
anything to do with PHP. I checked
'c:\windows\system32\drivers\etc\hosts' and it still contained a line
for '127.0.0.1 localhost'. I checked my network adapter configuration
and IPv6 had not been added as a protocol. My Apache configuration files
were untouched.
I spent two days searching high and low for a possible cause, and along
the way realized that the problem only occurred when PHP was involved:
HTML files were being served without any redirection issues.
When I replaced php.ini with an old version from a backup and
everything went back to normal, so I fired up a diff application and,
bit by bit, started replacing the contents of the newer php.ini with
lines from the old one.
I finally isolated the problem: the error_log line, which specified the
absolute path to a log file (the same path that had been working fine
with previous PHP versions). When the line is commented out, the
redirection problem goes away.
I double-checked the existence of the log file and made sure it was
writable. I then tried moving it to a different directory (updating
php.ini accordingly), but that didn't work either. I also tried changing
the path from "C:\Apache\logs\php_error.log" to
"file:///C:/Apache/logs/php_error.log" and that did make the redirection
problem go away, but no errors are actually logged, even though
'log_errors' is properly set to 'On'. If I set error_log back to
"C:\Apache\logs\php_error.log", the redirection issues comes back.
Reproduce code:
---------------
Line in php.ini:
error_log = "C:\Apache\logs\php_error.log"
Expected result:
----------------
Errors should be logged as usual.
Actual result:
--------------
Errors are not logged. Whether or not code contains any errors, browser
(both IE and Firefox) gets redirected from
http://localhost/path/to/script to
http://www.localhost.com/path/to/script.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48793&edit=1