Help and Support

You receive a "The specified CGI application misbehaved" error message

Article ID:145661
Last Review:December 3, 2007
Revision:4.2
This article was previously published under Q145661

SYMPTOMS

When you use a Common Gateway Interface (CGI) application with Microsoft Internet Information Server (IIS), the following error message appears:

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

Back to the top

CAUSE

This error is caused by the return of an incomplete or incorrect set of headers by the CGI application. The CGI application may be written incorrectly. As well, logic errors, API failures, or anything that causes the CGI application malfunction can also cause this error.

Back to the top

RESOLUTION

Modify the source code for the CGI application header output. The following is an example of a correct header:
   print "HTTP/1.0 200 OK\n";
   print "Content-Type: text/html\n\n\n";
				

If the CGI is written in C++, it is possible to debug the application and ascertain the problem. Instructions can be found in following article:
238788 (http://support.microsoft.com/kb/238788/) How to debug CGI applications running under IIS

Back to the top


APPLIES TO
Microsoft Internet Information Server 1.0
Microsoft Internet Information Server 3.0
Microsoft Internet Information Server 4.0
Microsoft Internet Information Services 5.0
Microsoft Internet Information Services 6.0
Microsoft Internet Information Server 2.0

Back to the top

Keywords: 
kbprb kbcgi KB145661

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.