Re: Premature end of script header error....

[email protected] (Hoenie Luk)
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
Hi David,

This may be just a shot in the dark, but I was dealing with the same 
"Premature end of header" error just a few days ago. It just so happen I 
neglected to place the correct path of perl.exe on the top of the cgi 
script before I ftp it to my web host. You know? The line that says:

#!/usr/bin/perl

Because I was testing the script on my windows machine, I had this line 
on top:

#!c:/perl/bin/perl.exe

And that was what was causing the premature end of header error.

Another possibility is if you forgot to give your cgi script execution 
privilege when you put it on the unix host. Did you?

.......Hoenie

David Moreno Garza wrote:
> On Wed, 2007-10-24 at 03:46 -0700, nexis wrote:
>   
>> This is a piece of code to print a graph object.
>>
>> ####
>> ....<code to generate/plot a graph skipped>
>> ...
>>        print "content-type: image/$graph_format\n\n";
>>         binmode STDOUT;
>>         print $img_obj;
>> ...
>> ####
>> This code works fine for me and I am able to see the graph. But when
>> the code goes on production     server, it gives Internal Server
>> Error. I have check the error logs and it says the premature end of
>> header.
>>
>> I have check all the graph modules GD, GD::TextAlign, GD::Graph all
>> are same on both machines.
>>
>> I use Apache 2.0.52, Perl 5.8.5
>> while the production runs Apache 1.3.29 , perl 5.8.0
>>
>> Is there any compatibility issue or is there something I dont know
>> about.
>>     
>
> I suggest you using CGI::Carp to trace those errors. On the top on your
> CGI place something like:
>
>  use CGI::Carp qw/fatalsToBrowser/;
>
> And see what comes up to your browser.
>
> --
> David Moreno Garza <[email protected]> | http://www.damog.net/
>  Yo te lo juro, de que por ley, aquí todas las boricuas saben karate.
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.