ID: 15409 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Apache related Operating System: RH Linux 7.2 (kernel2.4.9-13smp) PHP Version: 4.1.1 New Comment:
Of course the headers are only sent when output is done. I understand that. But the problem is that if there is no output other than the header, the header is not displayed at all! I just realized that a patch I quickly threw together for bug 15209 may be to blame. I'm quite confident that 15209 is a legitimate bug that needs attention (although nobody seems to have done anything with it). Before anybody wastes time on this bug, 15209 should take priority. Previous Comments: ------------------------------------------------------------------------ [2002-02-06 16:10:33] [EMAIL PROTECTED] Who told you you can print a header like that? Anyway... the headers are indeed only send when some output is done. ------------------------------------------------------------------------ [2002-02-06 16:05:15] [EMAIL PROTECTED] The following script works when php is called from the command line: <?php print header("Location: http://www.yahoo.com/"); exit; ?> [myhost] php test.php Location: http://www.yahoo.com/ Content-type: text/html But when called via the Apache server (1.3.20), I get nothing (and nothing in the error logs, so I don't think PHP is crashing): [myhost] telnet localhost 80 Trying localhost... Connected to localhost. Escape character is '^]'. GET /test.php HTTP/1.0 Connection closed by foreign host. But if I print some non-empty string after I print the header, it works: <?php print header("Location: http://www.yahoo.com/"); print "\n"; exit; ?> [myhost] telnet localhost 80 Trying localhost... Connected to localhost. Escape character is '^]'. GET /test.php HTTP/1.0 HTTP/1.1 302 Found Date: Wed, 06 Feb 2002 21:01:52 GMT Server: Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_ssl/2.8.4 OpenSSL/0.9.6b DAV/1.0.2 Location: http://www.yahoo.com/ Connection: close Content-Type: text/html This is not restricted to the Location header; other headers do not display either, unless followed by some non-null print statement. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15409&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php