php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52485 provided example doesn't work in all circumstances
Submitted: 2010-07-29 12:39 UTC Modified: 2010-09-21 17:49 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: c dot kworr at gmail dot com Assigned: markskilbeck (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.3 OS: FreeBSD-8.1
Private report: No CVE-ID: None
 [2010-07-29 12:39 UTC] c dot kworr at gmail dot com
Description:
------------
The sample code to return 404 is incorrect for FastCGI mode. in FastCGI mode it would return 200, unless "header('Status: 404 File not found');" would be added. This means 'Status: *' is the third special-case header call besides 'HTTP/1.*' and 'Location: *'

Test script:
---------------
<?php
header('Status: 404 Dead beef.')
?>
This will return 404 for FastCGI request.

<?php
header('HTTP/1.0 404 Dead beef.')
?>
This will return 404 for CGI request.

You need to specify both to get code working under all circumstances.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-21 17:49 UTC] markskilbeck@php.net
Automatic comment from SVN on behalf of markskilbeck
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=303643
Log: #52485 FastCGI 404 header
 [2010-09-21 17:49 UTC] markskilbeck@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: markskilbeck
 [2010-09-21 17:49 UTC] markskilbeck@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 09:00:02 2026 UTC