From:             memoimyself at yahoo dot com dot br
Operating system: WinXP SP3
PHP version:      5.3.0
PHP Bug Type:     Unknown/Other Function
Bug description:  Setting error_log in php.ini causes redirection

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 bug report at http://bugs.php.net/?id=48793&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48793&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48793&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48793&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48793&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48793&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48793&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48793&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48793&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48793&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48793&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48793&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48793&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48793&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48793&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48793&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48793&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48793&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48793&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48793&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48793&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48793&r=mysqlcfg

Reply via email to