From:             sales at 4web-space dot com
Operating system: windows 2003 standard
PHP version:      4.3.3
PHP Bug Type:     IIS related
Bug description:  Intermittent CGI Errors - PHP in CGI mode win2003

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 bug report at http://bugs.php.net/?id=25834&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25834&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25834&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25834&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25834&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25834&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25834&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25834&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25834&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25834&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25834&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25834&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25834&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25834&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25834&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25834&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25834&r=float

Reply via email to