homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
perl on networksolutions win server errors
migzam




msg:4337619
 1:07 pm on Jul 10, 2011 (gmt 0)

Hello, I recently had to move a working site that used perl and an access DB. we had to take over the site and move it to a new host. now none of the scripts work.

this is the error

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

any help would be appreciated.

 

phranque




msg:4337760
 11:50 pm on Jul 10, 2011 (gmt 0)

welcome to WebmasterWorld, migzam!

where did this error appear?
do you have access to the server error log file?
are you able to run the script from the command line on that server?

migzam




msg:4337844
 3:36 am on Jul 11, 2011 (gmt 0)

i dont have access to log or command prompt. the url is [artisthelpnetwork.com...]

phranque




msg:4337878
 7:08 am on Jul 11, 2011 (gmt 0)

what status code are you getting with the HTTP response?

migzam




msg:4337924
 1:51 pm on Jul 11, 2011 (gmt 0)

just the above error a general cgi error

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

they are tied to this hosting company and they offer no help at all. only that we can cancel the account.

rocknbil




msg:4337989
 3:55 pm on Jul 11, 2011 (gmt 0)

That is a generic and largely unhelpful error, similar to the 500 on Apache. What this most likely means is the script is either 500 erroring (an actual error) or it's just not outputting anything (just dieing.) On any request, a script must print a content-type header and output something to STDOUT (i.e., send a response back to the browser.) How you'd get to the root of it . . .

First, was it on Linux before? The windows environment is different for windows servers, especially in respect to permissions. Perl scripts need to be set executable, and chmod is not a Linux command. So you'll have to log in to your hosting CP to set those executable. If there are any files that need to be written, they need to be in a directory that is writable.

Next, always know what the environment variables are or even if you can execute scripts "from where you are" (this is particularly fussy on windows servers.) Add this little script somewhere - but REMOVE it as soon as you have the info:

#!/usr/bin/perl
print "content-type: text/html\n\n";
foreach $var (sort keys %ENV) { print qq|KEY: $var VAL: $ENV{$var}<br>\n|; }

If this won't run - see comments about executable. Once you get the envars script running, one of the important ones to note is DOCUMENT_ROOT. This is the full path to your server's root, and may be incorrect in your script configuration - open any config files to verify.

Last, once you get the environment variable script running, without access to error logs or other tools, you can begin debugging like so. Add the following three lines somewhere near the top of the script after #!/usr/bin/perl

print "content-type:text/html\n\n";
print "checkpoint one";
exit 0;

If that prints to the screen, you can remove it and move farther down in the script to identify the point at which it dies until you find the first stumbling block.

That is where you start, the info you glean from there will lead you to the specific problems you'll need to adjust.

migzam




msg:4338043
 5:31 pm on Jul 11, 2011 (gmt 0)

thank you rocknbil, i will try that code. this was hosted on a windows server for aboit 5 years without any issues. they forgot to renew it and the host canceled their account. now they set it up on netsolultions on a windows server.

they tell us that our scripts have issues but... how can that be if they ran for years. the old host no longer does windows on linux so they had to do netsol who claim they have no logs to show on a hosted account.

i appreciate your help!

phranque




msg:4338212
 12:38 am on Jul 12, 2011 (gmt 0)

just the above error a general cgi error

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

that's an error document, not the status code.
the status code would be a 3 digit number, such as:
200 OK
404 Not Found
502 Bad Gateway
...like that...

HTTP/1.1: Status Code Definitions:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html [w3.org]

migzam




msg:4338227
 1:10 am on Jul 12, 2011 (gmt 0)

no that's the entire message that comes up on the browser and that's the most frustrating thing about this. the hosting company wont provide one bit of information.

phranque




msg:4338334
 4:38 am on Jul 12, 2011 (gmt 0)

on firefox you can install the LiveHTTPHeaders plugin:
http://livehttpheaders.mozdev.org/ [livehttpheaders.mozdev.org]

that should show you the HTTP Response status code and all the HTTP response headers.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved