Gorby has asked for the wisdom of the Perl Monks concerning the following question:

Hello wise monks. I sometimes get this message on my server when people access my scripts from the internet:

Premature end of script headers: myscript.cgi

what does this mean?
Thanks in advance.

Gorby

Title edit by tye

Replies are listed 'Best First'.
Re: Premature...
by diotalevi (Canon) on May 14, 2003 at 03:31 UTC
Re: Premature...
by halley (Prior) on May 14, 2003 at 02:58 UTC

    The first output of a CGI script should be a header, such as:

    Content-type: text/html
    The first blank line output signifies the end of the header. If the script never output a blank line, for whatever reason, you get that error.

    Look up the CGI::Carp docs for some tips on diagnosing CGI scripts. Make sure your script doesn't use DOS line endings on a Unix server, especially at the end of the first shebang line. Make sure you have set the permissions for any uid on the server to execute the script. Check your server's logfiles.

    --
    [ e d @ h a l l e y . c c ]

Re: Premature end of script headers ?
by nite_man (Deacon) on May 14, 2003 at 06:15 UTC
Re: Premature end of script headers ?
by helgi (Hermit) on May 14, 2003 at 10:08 UTC
    perldoc -q 500 (aka "My CGI script runs from the command line but not + the browser. (500 Server Error)")
    will tell you a lot about what you want to know.
    perldoc -q messages (aka "How can I get better error messages from a C +GI program?")
    will tell you even more.

    --
    Regards,
    Helgi Briem
    helgi DOT briem AT decode DOT is