From:             [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version:      4.3.0
PHP Bug Type:     Reproducible crash
Bug description:  MSSQL/ODBC produce CGI Error:  

When calling a PHP script that is using MSSQL or ODBC calls, I can
reporduce this error at least one out of every ten tries, on multiple
machines.  I'm at the end of my rope trying to figure it out myself.  If I
can reproduce the error, I figure I am a prime candidate to help solve it.
 The error states:
 
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:

And that's it.  There is nothing after "are:"  

This is how I reproduce (test for) the error:  I have a PHP script that
generates a webpage.  That webpage contains 4 iframes.  (The iframes are
nothing more than a php page that echoes <html><body>x</body></html>.  The
main page prints the code to invoke the iframes, and it also makes an
MSSQL or ODBC query.  NOTE:  I can also reproduce this error when making a
database call in conjuction with a header("location: ...") redirect as
well, but that's a little more annoying to test than the iframes since it
doesn't happen every time.
 
So, every reload on the main page is essentially 5 PHP requests (1 main +
4 iframes).  If I refresh this test page, I can get at least one of the
iframes to error every 5 tries.  Which, of course, is at least one error
every 25 requests.  
 
Now on to the DB.  If I comment out the DB call (be it an MSSQL or ODBC
query) I cannot reproduce the error.  This is my guess...  the bug happens
when PHP attempts to service a request at the exact moment something
closes in the DB call.  I'm sorry I can't do any better than that for
troubleshooting.  But, logically, the error is random enough that it
doesn't happen EVERY time, so all I can guess is that it is a pure timing
issue, which happens more frequently the more you hit the server as it is
making a DB request.
 
Any other info I can offer...  I can reproduce this with IIS  on three
Win2000 Servers and one Win2000 Professional box.  I am not using Named
Pipes.  I've tried several versions of ntwdblib.dll and am currently using
the one included with PHP 4.3.0 (12/27/2002).  I only have SQL 2000
servers to connect to, but I've reproduced this bug with the three of them
that I use regularly.
 
My desktop (the Windows 2000 Professional) box is what I test with most
often, and it is running Service Pack 3 and is using the current MDAC (2.7
I believe).
 
I did not use the Win32 'installer' ... rather installed via the latest
.zip and my production boxes are SMP machines, so until SAPI is given the
thread-safe go-ahead I have to stick with the .exe
 
I can't think of anything more off the top of my head, but I would be more
than willing to give whatever feedback is requested.  Unfortunately, I
thought this bug was only MSSQL related for some reason, so I've been
putting off switching everything to ODBC.  I was very saddened today when
I experienced the error with ODBC as well.  I've got approximately one
week to solve this before I have to launch a new site with my company, and
while the lauch will go either way, I don't want the executives to
question my decision to use PHP instead of VBscript (as the other
developers here know VB, and my argument/skills seemed strong enough to
sway to the PHP side).  I'm not trying to pull any heart strings here,
like I said, the site is going to launch CGI errors or not, I'd just
rather have it flawless (and not field end-user calls on the issue to
boot).     
-- 
Edit bug report at http://bugs.php.net/?id=21872&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21872&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21872&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21872&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21872&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21872&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21872&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21872&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21872&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21872&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21872&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21872&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21872&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21872&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=21872&r=gnused

Reply via email to