|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-01-21 06:58 UTC] progcom@php.net
Description:
------------
CGI version PHP does not handle 'Status: xxx' header.
By CGI 1.1 Spec, header('Status: xxx') can produce http response code.
(I can use 'HTTP/1.0 xxx', but I think CGI version should work with 'Status: xxx')
on http://hoohoo.ncsa.uiuc.edu/cgi/out.html ,
Status
This is used to give the server an HTTP/1.0 status line to send to the client. The format is nnn xxxxx, where nnn is the 3-digit status code, and xxxxx is the reason string, such as "Forbidden".
Reproduce code:
---------------
<?php
header('Status: 303 See Other');
header('Location: http://example.org');
?>
Expected result:
----------------
Status: 303
Content-type: text/html
Location: http://example.org
Actual result:
--------------
Status: 302
Content-type: text/html
Status: 303 See Other
Location: http://example.org
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
This works: <?php header('Location: http://example.org', 0, 303); ?> And next time, RTFM!Yes, It works, but PHP manual also said: 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. <?php header("Status: 404 Not Found"); ?> It will be document problem? I don't know Apache's mod_cgi or other servers work with double 'Status' header, but I'm using PHP by FastCGI (mod_fcgi), It says: FastCGI: comm with server "/path/to/php" aborted: error parsing headers: duplicate header 'Status' I think PHP should follow CGI Spec., at least CGI version, isn't it?