|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-01-23 15:42 UTC] achowe at snert dot com
Description:
------------
While testing a 3rd party HTTP server (under Cygwin) that expects nph CGI behaviour, I have the following script:
#!/usr/local/bin/php-cgi
<?
header("HTTP/1.0 200 OK");
phpinfo();
?>
When called, the "HTTP/1.0 200 OK" line is never sent. If I rewrite the script to change the status code:
#!/usr/local/bin/php-cgi
<?
header("HTTP/1.0 300 OK");
phpinfo();
?>
Only then does the "HTTP/1.0 300 OK" appear as expected. This result can be verified by a telnet connection to the server or on the command line.
Expected result:
----------------
If I explicitly set:
header("HTTP/1.0 200 OK");
then I expect to see it in the output as the first line.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 03:00:01 2025 UTC |
Creating yet another option seems a bit much when you know that an nph chi will have to set the header in the code. Why can't you just say if the header is explicitly set, then print it regardless of its value. For me I see it as inconsistant behaviour. If I do nothing, I get no header, if I set the status header to 200, I still don't get a status header even though I put code in to explicitly send it. If I specify anything anything other that 200, I get a status header. So my work around has been to send an undefined 2xx header to indicate undefined success, though not exactly what I would have liked. So far Mozilla, Opera, Internet Explorer, and Lynx appear to work, while Links does not (though I suspect for unrelated issue). #!/usr/local/bin/php-cgi <? header("HTTP/1.0 299 OK"); phpinfo(); ?>