ID: 25834 Comment by: willy at vuboys dot nl Reported By: sales at 4web-space dot com Status: No Feedback Bug Type: CGI related Operating System: windows 2003 standard PHP Version: 4.3.3 New Comment:
Hello, I get reports from different users running PHP in CGI mode on a Windows platform about the same issue. The strange thing is that it does not happen all the time, but occasonally. Hitting refresh in the browser will load the page afterwards without a problem. As far as I know it is still happening on PHP4.3.4. Is there something in the PHP script what can be done to prevent it? or is it a bug in PHP itself? Previous Comments: ------------------------------------------------------------------------ [2003-10-19 10:24:04] [EMAIL PROTECTED] No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2003-10-12 22:07:53] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2003-10-11 08:03:30] sales at 4web-space dot com Description: ------------ Hello, thought i submitted this before but obviously not PHP scripts are intermittently returning CGI Error - did not return a full set of headers This was also a problem with perl and Microsoft pointed it out to be the following problem. The following solved the same error in Perl and from what I understand headers are nothing to do what the coder adds to their php scripts but what php.exe puts in. Anyway here is what they say im hoping its what the problem is (please read IIS6's rules that are enforced) Even though these rules are enforced they only cause intermittent issues with scripts Basically IIS6 enforces additional rules that previous IIS versions didnt For your CGI, it needs: print "Status: 200 OK\r\n" There are a couple of CGI rules being enforced on IIS6: 1. Per CGI 1.1, a response must contain the "Content-Type" header, optionally the "Location" header, and also indicate the Status code via either the "Status" header or something like "HTTP/1.1 200 OK\r\n". This is a big gotcha for people. 2. Headers must be terminated with \r\n per HTTP 1.1 spec. #2 has some peculiarities in that depending on the CRT's IO Mode -- in Text mode, "\r" will be inserted for you for every "\n", while in Binary mode, no such thing is done. This means that since you need to be certain that "\r\n" terminates every header for IIS -- either you run in binary mode and send the "\r\n" yourself, or you run in text mode and only send "\n". Reproduce code: --------------- any code Expected result: ---------------- it will load all the time Actual result: -------------- intermittent cgi errors - not returning full set of headers ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25834&edit=1