php.net |  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
Votes:3
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: beezlebob666 at yahoo dot com
New email:
PHP Version: OS:

 

 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] jani@php.net
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());
?>

 [2008-08-12 14:44 UTC] jani@php.net
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: Sat Jul 13 03:02:22 2024 UTC