#31519 [Opn]: Setting Status: 559 works using php-cgi but not using Apache 2 module
| From: | jed@php.net | Date: | Wed, 12 Jan 2005 21:00:03 +0000 |
| Subject: | #31519 [Opn]: Setting Status: 559 works using php-cgi but not using Apache 2 module | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71986@lists.php.net to get a copy of this message | ||
ID: 31519
Updated by: jed@php.net
Reported By: trevor dot wekel at autodesk dot com
Status: Open
Bug Type: Apache2 related
Operating System: Windows XP
PHP Version: 5.0.3
New Comment:
From the HTTP/1.1 spec, §6.1.1:
"For example, if an unrecognized status code of 431 is received by the
client, it can safely assume that there was something wrong with its
request and treat the response as if it had received a 400 status
code."
5xx is treated as 500 by applications that don't understand it. Why
this behavior pops up in SAPI but not CGI, I'm not sure. Perhaps Apache
2 does not parse CGI return codes, but does for built-in modules?
Previous Comments:
------------------------------------------------------------------------
[2005-01-12 17:09:09] trevor dot wekel at autodesk dot com
Description:
------------
The following PHP script returns different HTTP response status codes
when run using php-cgi.exe and run as a Apache module.
Versions of software installed:
PHP 5.0.3 zip donwloaded from Php.net
http://www.php.net/get/php-5.0.3-Win32.zip/from/a/mirror
Apache 2.0.52 from Apache.org
http://apache.secsup.org/dist/httpd/binaries/win32/apache_2.0.52-win32-x86-no_ssl.msi
I can also post my httpd.conf and php.ini files if required. No
special tweaking was done other than the standard PHP setup for Apache
2 documented here:
http://www.php.net/manual/en/install.windows.apache2.php
Reproduce code:
---------------
<?php
header("HTTP/1.1 559 CustomError");
header("Status: 559 CustomError");
echo "<html>\n";
echo "<body>\n";
echo "Error on page!!!\n";
echo "</body>\n";
echo "</html>\n";
?>
Expected result:
----------------
I would expect to see an HTTP response status code of 559 returned when
running under both the php-cgi and the Apache 2 module.
Actual result:
--------------
When running under php-cgi, the 559 HTTP response status code is
returned. When under the Apache 2 module, an HTTP 500 Internal Error
is returned.
Note: The "Status:" line is returned correctly but it does not match
the response status code.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31519&edit=1