Re: Premature end of script headers

[email protected] (Adam Jimerson) Sun, 16 Nov 2008 15:41:52 -0500
Newsgroups perl.beginners.cgi,perl.beginners.cgi
Organization SE
Message-ID <[email protected]>
"Mike Williams" wrote:

>> [email protected] wrote:
>> > Hello,
>> >
>> >     i need to know the reasons for this error "Premature end of script
>> > headers" i checked with my http header content-type:text/html ,but i
>> > had not solved yet..
> 
> 
> Often this happens when some error occurs in your code before you output
> the headers.
> 
> Try putting this near the top of your script:
> 
> use CGI::Carp qw(fatalsToBrowser);
> 
> this will redirect fatal errors to the browser window - see perldoc
> CGI::Carp for more info.
> 
> If neither this nor Sean's suggestion helps post your code so we can take
> a look.
> 
> Mike

I also had this problem the other day the web browser said that there was a "Premature end of script headers" but the Apache log said that it was a problem with permissions.  Checking my script shows that I forgot to make it executable.  It might be worth checking the obvious and see if you have a similar problem.