Problem: "Application misbehaved" error message
This article applies to any CGI program running on Microsoft IIS.
Last Updated: 23 May 2002
When you run a CGI program, the server says the application "misbehaved," and that there were
either missing or incomplete headers.
If you get an error about missing or incomplete headers, then you probably haven't given
sufficient file permissions to the system DLLs (in C:\WINNT35\SYSTEM32 or C:\WINNT\SYSTEM32,
usually). This error message is especially frustrating, since it tells you that the CGI
program misbehaved, where in fact it is the server's problem. If for any reason the server
cannot launch the CGI program, then the CGI program won't run. If the program doesn't run,
it won't produce any output. If it doesn't produce any output, IIS tells you that the CGI
program misbehaved. An error message saying WHY the server couldn't run the CGI would be
much more informative.
Give the IUSR_<machinename> account Read permissions to the system DLLs, and Change
permissions in the temp directory. Enable security auditing and check for access denied
messages if the problem persists.