|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-08-03 11:01 UTC] beezlebob666 at yahoo dot com
Description:
------------
In ISAPI mode on IIS on XP, header() does not send anything to the browser. Pear not installed, zend not installed, all .dll files unloaded, default php.ini-dist used. Uninstalled and reinstalled as a CGI mode and it appears to work fine.
Reproduce code:
---------------
<?php
header('HTTP/1.1 404 Not Found');
var_dump(headers_list());
?>
Expected result:
----------------
Expected to redirect to any 404 page.
Actual result:
--------------
Blank page with no content.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 10:00:01 2025 UTC |
From the manual page for header(): "Note: The HTTP status header line will always be the first sent to the client, regardless of the actual header() call being the first or not. The status may be overridden by calling header() with a new status line at any time unless the HTTP headers have already been sent." The correct way to send such headers: <?php header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); var_dump(headers_list()); ?>