|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-06 16:10 UTC] derick@php.net
[2002-02-06 16:13 UTC] priebe at mi-corporation dot com
[2002-02-06 16:14 UTC] derick@php.net
[2002-02-06 16:17 UTC] priebe at mi-corporation dot com
[2002-02-06 16:18 UTC] derick@php.net
[2002-02-06 16:33 UTC] priebe at mi-corporation dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 06:00:01 2025 UTC |
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.