|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45697 ISAPI mode header() doesnt send any headers
Submitted: 2008-08-03 11:01 UTC Modified: 2008-08-12 14:44 UTC
Avg. Score:4.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: beezlebob666 at yahoo dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 5.2.6 OS: XP Pro
Private report: No CVE-ID: None
 [2008-08-03 11:01 UTC] beezlebob666 at yahoo dot com
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:
header('HTTP/1.1 404 Not Found');

Expected result:
Expected to redirect to any 404 page.  

Actual result:
Blank page with no content.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-06 00:18 UTC] japan at email dot de
This sounds like a comparable Sympom of my error message Bug # 45615 of the 2008-07-24
 [2008-08-06 05:44 UTC] beezlebob666 at yahoo dot com
Oh and for the record, I have tried setting php.ini with the following:

; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request.
cgi.nph = 0

cgi.rfc2616_headers = 0

Although its not in cgi mode,its ISAPI mode so, despite my inexperience, makes sense to try, but it didnt resolve the issue.

I have also run a header scanner on my server also, and even though I dont see it, its as if the server is sending a Status: 200 OK before sending Status: 404
 [2008-08-12 14:43 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:

header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');

 [2008-08-12 14:44 UTC]
Also note: Running PHP as ISAPI module is not really supported. Even Microsoft suggests using FastCGI. 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 17:01:30 2024 UTC