Bug #13933 Updated: error_log and HTTP redirect using header conflict

From: Date: Tue, 05 Feb 2002 23:34:34 +0000
Subject: Bug #13933 Updated: error_log and HTTP redirect using header conflict
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-79292@lists.php.net to get a copy of this message
ID: 13933 Updated by: yohgaki@php.net Reported By: bonseb@free.fr -Status: Assigned +Status: Closed Bug Type: Output Control Operating System: Windows NT4 SP6 PHP Version: 4.0.6 Assigned To: yohgaki New Comment: This bug has been fixed in CVS. Previous Comments: ------------------------------------------------------------------------ [2001-12-31 19:17:16] zak@php.net Assigning this to Yasuo :) ------------------------------------------------------------------------ [2001-12-12 04:51:21] yohgaki@php.net Zak, is this bug analyzed? I'm trying to sort out output buffering problems. Thanks. ------------------------------------------------------------------------ [2001-12-10 20:40:37] zak@php.net Assigning it to myself so that I don't forget about it. :) ------------------------------------------------------------------------ [2001-12-05 04:24:00] bonseb@free.fr I finally found time to test. Here it goes. First of all, PHP config is: error_log is not set display_errors is off log_errors is on error_reporting is standard (E_ALL & ~E_NOTICE) Then, the page I'm testing: <? error_log ("this is a test", 0); header("Location: index.php"); ?> And finally, the results: - in Apache's log file, I get these two lines: [Wed Dec 05 10:09:59 2001] [error] [client 172.22.50.91] this is a test [Wed Dec 05 10:09:59 2001] [error] [client 172.22.50.91] PHP Warning: Cannot add header information - headers already sent in d:\wwwroot\htdocs\csf_recette\titi.php on line 3 - the source of the generated page displayed in IE is as follow, eventhough nothing has been output: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD> <BODY></BODY></HTML> Conclusion: - error_log works fine, it does what I expect, but it might do a little more; - PHP complains about something being output *before* the call to header. I've tried removing this call (to header), my message is logged, and I *still* get the same output; - thus, somehow, the call to error_log produces PHP or Apache to generate this unexpected HTML code while logging; I've tried almost the same settings on another server (difference in php.ini is display_errors on) and it works quite fine. Could there be other parts of PHP's configuration, or even Apache's conf, altering the expected behaviour ? ------------------------------------------------------------------------ [2001-11-12 19:54:19] sniper@php.net Status -> feedback (Zak! try to remember? :) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/13933 -- Edit this bug report at http://bugs.php.net/?id=13933&edit=1

« previous php.dev (#79292) next »