Re: "premature end of header" script error
- From: mritty@xxxxxxxxx (Paul Lalli)
- Date: Thu, 29 Nov 2007 10:04:58 -0800 (PST)
On Nov 29, 11:44 am, jainan...@xxxxxxxxx (Ankur) wrote:
Hi,
I am receiving the following error : "Premature end of script headers"
when running my CGI script using a web browser.
Instead if I execute the script manually at the shell, it executes
successfully. Actually, the script needs to fetch a lot of data from
the database.
I couldn't find any related reference for this error description on
the web, though there are a lot of other references.
This has nothing to do with Perl and everything to do with CGI
programming.
My guess you forgot to print the HTTP Header. You're claiming it
"works" on the command line, because you saw your HTML output appear
in the console window. But did you also see something that looks
like:
Content-Type: text/html; charset=ISO-8859-1
If not, you've forgotten to print the header. If you're using the CGI
module (and if you're not, you should be), just stick this line before
any of your print statements:
print header;
Paul Lalli
.
- References:
- "premature end of header" script error
- From: Ankur
- "premature end of header" script error
- Prev by Date: Re: "premature end of header" script error
- Next by Date: Re: Variable division, assignment and sprintf in one line
- Previous by thread: Re: "premature end of header" script error
- Index(es):
Relevant Pages
|