|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-10-04 04:47 UTC] madcamel at gmail dot com
[2007-10-22 08:54 UTC] jani@php.net
[2007-10-23 16:25 UTC] madcamel at gmail dot com
[2007-10-30 22:15 UTC] jani@php.net
[2007-11-01 11:16 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 05:00:01 2025 UTC |
Description: ------------ When PHP is used as a FastCGI it outputs incorrect Status: headers. For example, a redirect triggered by header("Location: http://x.com/") returns "Status: 302", not "Status: 302 Moved Temporarily" as is explicitly required by the FastCGI specification. This leads to most web servers returning "HTTP/1.1 302" instead of "HTTP/1.1 302 Moved Temporarily", thereby breaking some very picky browsers. This problem also also occurs with 404 if a PHP file could not be found, and I'm sure every other type of "Special" response. This makes it different than bug 41738. Related bugs: http://bugs.php.net/bug.php?id=41378 http://bugs.php.net/bug.php?id=31065 http://bugs.php.net/bug.php?id=36705 Reproduce code: --------------- --- Test 1 <?php header("HTTP/1.1 302 Moved Permanently"); header("Location: http://www.google.com/"); ?> $ php-fcgi fun.php Status: 302 Location: http://www.google.com/ Content-type: text/html --- Test 2 <?php header("Location: http://www.google.com/"); ?> $ php-fcgi fun.php Status: 302 Location: http://www.google.com/ Content-type: text/html --- Test 3 <?php header("Status: 302 Moved Temporarily"); header("Location: http://www.google.com/"); ?> $ php-fcgi fun.php Status: 302 Status: 302 Moved Temporarily Location: http://www.google.com/ Content-type: text/html Note the duplicate "Status:" headers, which is dissallowed by the FastCGI spec.