PDA

View Full Version : Need help in CGI Error!! Please its urgent


tarun.rathaur
08-14-2007, 07:56 AM
I have an application written in Perl-CGI which also uses some .NET executable to perform some operations. The problem is that whenever the CPU utilization increases to 100%, the website starts giving the following error message

The specifed CGI application misbehaved by not returning a complete set of HTTP headers

Although the page on which this error occurs already has a line that prints the following header before printing anything else on the screen.

print qq(Content-Type: text/html; charset=ISO-8859-1\n\n);

One catch in this problem is that, this error propagates to every link I click on the web- site.

The web site is hosted on Windows Server 2003 and IIS6.0.

Could any one please look in the scenario and help me in resolving this problem?
I guess the problem is not with the code because in some environments the application works smoothly. So it may be some environment issue.
Has any one gone through this type of issue. Please help me resolve this issue.

Thanks in advance

FishMonger
08-14-2007, 08:07 AM
What does your script do prior to printing the content header?

IF your header is the first print statement, then some statement prior to it is generating an error message which in turn generates the "The specifed CGI application misbehaved by not returning a complete set of HTTP headers" error.

Can you post your code?

On a side note...why aren't you using the CGI module to output the header?

KevinADC
08-14-2007, 11:07 AM
cpu is using 100%? Are you on a shared server? If so the script is probably being terminated by the server. Your host will let you know if that is the case.

tarun.rathaur
08-14-2007, 11:08 AM
The script just uses the following modules before printing the header.

use strict;
use XML::Simple;
use Data:: Dumper;
use File::Spec;
use File::Basename;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);