From:             salmanarshad2000 at yahoo dot com
Operating system: Windows XP, 2000
PHP version:      4.3.3
PHP Bug Type:     IIS related
Bug description:  The specified CGI application misbehaved ...

Description:
------------
This bug or issue has been around for quite a while and seems like nobody
cares. The bug list is filled with hundreds of complains about the "The
specified CGI application misbehaved ..." error each time these people
have BOGUSed or CLOSEd saying things like "The version you are using is
too old, please try the latest version ...", "This is not a php bug,
please go to ...", "Not enough evidence ..." or "Problem with Windows, not
PHP". Quite a few versions of php have been released in the meanwhile, but
this issue hasn't been fixed, people who upgrade their php installation
come back with the same complains. I see no good reason for this
ignorance.

Problem Statement
-----------------
When browsing a php application, the IIS server randomly throws the error
message:

CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
<BLANK>

Observations
------------
This happened only when:
- PHP.exe is used as a CGI on IIS 
- The php scripts contained 2 or more frames (e.g. phpMyAdmin)
- MySQL operation was executed (update, insert, delete etc.)
- header("Location: ...") is used to redirect user after a MySQL operation
to a page that also performs a MySQL operation
- The pages are viewed from local computer
- A very fast computer is used

This did not happened when:
- Apache server for windows with php support was used
- The php scripts contained 2 or more frames but all frames contained php
scripts with Hello World and a random number
- Frequency of errors was much lesser when same pages were accessed from
the network
- Pentium 2, 300 MHz was used (a slow computer)

History
-------
Following bugs are all related to this problem. This is just a reminder
for the fact that this issue has been discussed quite a few times and it
is still present. People also found these interesting things that might
help to get the problem solved.

- BugID #25567 getting errors when doing a mysql_db_query() and then
header("location")
- BugID #24916 header("location")
- BugID #23208 using two or more frames
- BugID #19381 no details :(
- BugID #19676 works on one (slow) system but does not work on other
- BugID #18901 header("location") after delete or update, error occurs
under under load
- BugID #16313 header("location") and db operations
- BugID #23050 mysql_query() followed by header("location")
- BugID #17468 header("location")
- BugID #9852  thousands of lines describing the problem, including
frames, manually slowing down the script, pages work from outside the
machine nut not locally, two database connections in rapid succession etc

Things that have been said earlier
----------------------------------
"This is a problem with Microsoft OS"
No this is not, it works on exact same OS running on slower hardware or
when the application is accessed across a network. And even if it is, the
developers should try to find a work around instead of blaming M$ and
telling it to fix it. After all, when you develop some app for an
environment, you don't change the environment to suit your app (although
sometimes it is easier to do so).

"This is not a php bug"
Well this could be right, since there is one other suspect, MySQL. But
somebody please figure out where the problem is? Also, MySQL is now an
integral part of php so problem could lie in the integration part.

My Opinion
-----------
May be php.exe is not fast enough to keep up with the pace at which IIS
can throw requests at it. Or ... may be it is a problem with the MySQL
connections ... attempting to create connections too quickly may be the
cause. Users having same problem please feel free to contribute with their
observations and suggestions.


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

Reply via email to