Closed (won't fix)
Project:
Drupal core
Version:
x.y.z
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
31 Aug 2006 at 20:00 UTC
Updated:
24 Oct 2006 at 23:06 UTC
Jump to comment: Most recent file
I have Drupal (4.7.3) installed on a Dreamhost server (PHP 5 as Fast CGI). When I have the 'Site Maintenence' enabled to have my site offline, it returns a '503 OK' header instead of '503 Service unavailable'. In the drupal_set_header function, headers that are sent in the format 'HTTP/1.x [Code] [Message]' need to be translated to 'Status: [Code] [Message]'. I'm not sure how Drupal could determine when this needs to be done, but I've included the path that I had to change in my Drupals common.inc file.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | patch_25.txt | 610 bytes | dave reid |
| #3 | patch_24.txt | 608 bytes | dave reid |
| patch_23.txt | 497 bytes | dave reid |
Comments
Comment #1
dave reidComment #2
drummThis will have to be revised to check how PHP is running.
Comment #3
dave reidI found what code is needed to determine if PHP is running as CGI. Uploaded the revised patch.
Comment #4
dave reidFixed logic error in patch
Comment #5
dave reidComment #6
dries commentedI don't understand, and the code comment isn't sufficient:
+ // If PHP is running as CGI, certain headers need to be translatedWhy? What is the underlying technical reason?
Comment #7
dave reidAs described in the initial bug description, when PHP is running as CGI and you try and send header('HTTP/1.1 503 Service Unavailable') or similar header, the actual result is a '503 OK' header in the browser. I'm pretty sure it's a bug in the PHP/CGI interface. Those kind of headers (HTTP/1.x [code] [description]) need to be sent as header('Status: [code] [description]').
Comment #8
Crell commentedMaybe I'm missing something, but why would you want to run PHP as CGI for something as large as Drupal in the first place? mod_php is far faster and better maintained.
Comment #9
dave reidActually I'm running my website with PHP 5 and Fast CGI. It runs just as fast as mod_php and for my webhost (Dreamhost) it's pretty much required for large php applications. They have a pretty secure and fast setup on their servers, so it's not a speed issue.
Comment #10
gerhard killesreiter commentedI can reproduce the problem on my fast-cgi install. Can't say I terribly like the patch though.
Comment #11
dries commentedWhat do you mean with 'a bug in the PHP/CGI interface'? Shouldn't that be reported against PHP then?
Crell: http://buytaert.net/drupal-webserver-configurations-compared
Comment #12
Kjartan commentedMarking at won't fix.
a) It is a bug in PHP not Drupal.
b) Clients should be using the Status-Code and not the Reason-Phrase to make judgements.
The patch would just add complexity for no real gain. And should a lot of clients missbehave and go by the Reason-Phrase, this only matters for the maintenence screen which should be a pretty rare occurance.