#25863 [Com]: IIS: The specified CGI application misbehaved

From: Date: Mon, 27 Sep 2004 16:49:22 +0000
Subject: #25863 [Com]: IIS: The specified CGI application misbehaved
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66766@lists.php.net to get a copy of this message
ID: 25863 Comment by: jvanhoy at archermalmo dot com Reported By: salmanarshad2000 at yahoo dot com Status: Open Bug Type: CGI related Operating System: win32 only PHP Version: 4CVS, 5CVS, 6CVS.. New Comment: Another clue about this weird bug is.... If you make undefined or bad system calls on a Windows box the app will throw this error. For example, in moving a PHP app from a *nix environment to a Windows2003 Server env. the following line of code WILL cause the "CGI Heart attack" to occur: system("rm /usr/local/apache/sessions/$THIS_SESSID"); That dog won't hunt on an NT machine and causes this error to occur. Remove the line (or rewrite it to use the proper NT syntax) and the error goes away. Previous Comments: ------------------------------------------------------------------------ [2004-09-11 16:53:47] moricio at hotmail dot com Hi! I have come to this error all the time and finally decided to do something and **SURPRISE** it worked!! And I say it worked because I tried it before and didn't work at all. The solution is to install PHP under IIS as an ISAPI module and not as a CGI processor. I have Windows XP, IIS, MySQL, PHP 4.3.4 and is working great without this problem. Also, follow the exact instructions as they appear in the install.txt file in the php directory. bye. ------------------------------------------------------------------------ [2004-09-08 20:37:21] salmanarshad2000 at yahoo dot com The same problem was also noticed on Windows Server 2003 machine with IIS 6.0, php version 4.3.6, and mysql 3.2x.xx, faulting php application is moodle (www.sourceforge.net). The "CGI application misbehaved" error appears randomly on pages that contain lots of mysql_query() and header( "location: " ). ------------------------------------------------------------------------ [2004-09-08 16:41:34] philip@php.net People, please do not add comments to this bug report. If you have a problem with the IIS documentation, see php bug #25863 ------------------------------------------------------------------------ [2004-09-08 10:06:25] roger dot gusthage at home dot se I've solved me problem by adding a redirect file between my login page and start page. This way it seems that my use of header("Location: yada yada"); got some breathing room and could "catch" up and smoothly go to my start page instead of throwing a CGI error ... I use IIS 5, W2000 server with frames on start page and got the error only when i used header-function above or when i refresh my page quickly. This is not the best solution, but could be usefull in login-situation where i now put some text to tell the user that the login is processing. Redirect i used meta tag and only 1 sec delay. Hope this might solve the problem for some of you. ------------------------------------------------------------------------ [2004-06-29 12:03:00] closedbolt at gmx dot de Seems like php.exe in php 5 rc3 does not prepend any headers. --> cgi error in IIS php-cgi.exe does... --> works fine for me now. Example: test.php <? echo "hi"; ?> C:\php>php.exe test.php hi C:\php>php-cgi.exe test.php Content-type: text/html X-Powered-By: PHP/5.0.0RC3 hi C:\php> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/25863 -- Edit this bug report at http://bugs.php.net/?id=25863&edit=1

« previous php.bugs (#66766) next »