Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI error (The specified CGI application misbehaved by not returning a

Status
Not open for further replies.

subok

MIS
Feb 21, 2005
37
BE
Hi,

I'm a new in Perl scripting and would like to ask some help regaring the following error when I move my file to a new server. I thought I was only simple copy and past but when I tried to access my web page using the new server i get the following error when browser execute my perl scripts :

************
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
***********

I was tipped that 'print header' can be missing, so I tried to put in one of the scripts it works in part but not in the other parts. In short, this error keeps on coming back. Can this 'print header' be globally defined in my IIS server?

Thanks for any help or suggestions.

Kr,
Subok
 
Add this line near the beginning of the script:

Code:
use CGI::Carp qw/fatalsToBroswer/;

rerun the script and see what happens. Report back any new error messages.



------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Hi,

I added the neqw at the beginning of the script and get the same error

 
Can you get any perl scripts to run in the new server? Does the new server require a shebang line? Something like:

#!/usr/bin/perl

did you upload the perl files to the new server in ASCII (text) mode and not binary mode? Do you need to set any permissions? Does the new website have any FAQs you can read about running scripts on the new server you are using?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Hi,
Following is some parts of the script:

#!perl
# get_hlr_data.pl
use strict;
use CGI qw:)all);
use Fcntl qw:)flock);
use DBI;

my $logonid=$ENV{'LOGON_USER'};

my ($DSN, $dbh, $sth, $user, $ug, $aut, $username);
my @row;
my $sql="SELECT * FROM CLIUsers WHERE USERID LIKE '$logonid'";

my $cmdfilename = param('FILENAME');
my $nextswitch;
my @switch;
my @imeilist;
my $line;

my $defcolor="FFFFFF";
my $greycolor="A7A7A7";
my $cftelecolor=$defcolor;
my $cfts60colo$defcolor;
my $cfbs20color=$defcolor;
my $cfbs30color=$defcolor;
my $path;
my $type=param('TYPE');
my $command;
my $chgmsin;
.
.
.
<more variables>
.
.
# START OF SCRIPT
if (defined param('submit')){
get_user_data();
$origug=$ug;
$path = join ('',"z:/Inetpub/ $hlrfile = join ('',$path, $logonid, "_log.txt");
$mscfile = join ('',$path, $logonid, "_log.txt");
unlink $hlrfile;
unlink $mscfile;

if ($ug eq "" and $aut eq ""){
print redirect('../notuser.html');
}
if ($type eq "1"){
$msisdn = param('INPUT');
get_hlr();
#***********************************
#* Generate cli command *
#***********************************
$command = "cli mml -n $hlr -o $hlrfile -i \"dispmsub:sn=$sn,datakd=diagdata,ndc=$ndc\" -g \"$ug\"";
}
 
Are you printing the html headers anywhere in there? If you are try printing them at the top of your scripts. Possibly it is erroring out and unable to print the message because of the lack of headers.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
subok,

Can you get any perl scripts to run in the new server? Does the new server require a shebang line? Something like:

#!/usr/bin/perl

did you upload the perl files to the new server in ASCII (text) mode and not binary mode? Do you need to set any permissions? Does the new website have any FAQs you can read about running scripts on the new server you are using?



------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
yes, it's the shebang (path was missing)and some scripts needs 'print header' thing.

Thanks guys!

 
problem solved then?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top