From: php_bugs at ecora dot de
Operating system:
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: Status header with PHP CGI
Description:
------------
Hi,
<Documentation>
header("HTTP/1.0 404 Not Found");
[...]
Note: In PHP 3, this only works when PHP is compiled as an Apache module.
You can achieve the same effect using the Status header.
header("Status: 404 Not Found");
</Documentation>
IMHO this is not correct. Because the HTTP-status-header (also
Content-Type- and Location-Header) is always a server parsed header, when
PHP (PHP3, PHP4, PHP5 or also Perl or Python, ...) runs via CGI.
The official CGI Specification (see http://www.w3.org/CGI/):
http://hoohoo.ncsa.uiuc.edu/cgi/out.html
That means not only in PHP3 also in PHP4 or PHP5: When PHP runs via CGI,
then you have to write:
header("Status: 404 Not Found"); instead of header("HTTP/1.0 404 Not
Found");
Reproduce code:
---------------
When i try to send a header("HTTP/1.0 404 Not Found"); on my installation
(Apache 1.3.29 + PHP 4.2.3 CGI on Linux) then i receive a 500 internal
server error
--
Edit bug report at http://bugs.php.net/?id=27345&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27345&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27345&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27345&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27345&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27345&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27345&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27345&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27345&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27345&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27345&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27345&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27345&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27345&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27345&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27345&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27345&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27345&r=float