12-16-2003, 02:13 PM
I use my ftp program to upload perl scripts to my cgi-bin, change the first line to point to the perl interpreter, chmod all directories and files as stated in the readme.txt but I am still getting this message:
Premature end of script headers
This is happening with every script I upload and I can't get any of them to work. This is driving me crazy!
Does anyone have a solution other than just give up.
12-16-2003, 05:08 PM
I typed 'Premature end to script headers' into google and got many, many hits.
Here is an example:
In Response To: Re: Premature end of script headers (sproket)
: I just had a similar problem with a more recent version of
: perl that required me to change my invocation line to
: #!/usr/bin/perl -w
: apparently the -w has become more important.
The issue isn't with Perl, but how Perl is being executed by the webserver. Aparantly they have a layer inbetween or they've compiled Perl with custom settings..
The -w switch is for warnings... It will tell you things like if a variable is used only once (which suggests a typo in the variable name) and other things that will not necessarily cause any problems with the script. Furthermore, most of the time with scripts which require code libraries (which are dynamic - such as WebAdverts and WebBBS use) the -w switch generates all kinds of warnings because the compiler can't know what the run-time value is so it can't check that code library for 'errors' so it generates all sorts of warnings...
From here - http://awsd.com/scripts/forum/webadverts/index.cgi/noframes/read/53649
which I followed from here - http://awsd.com/scripts/forum/webadverts/index.cgi/noframes/read/53646
Originally from here - http://www.google.ca/search?q=Premature+end+of+script+headers&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google+Search&meta=
I know that I had to learn to search on Google and Teoma, also Ask Jeeves gives good results to my questions.
Sometimes your hosting provider has a help section as well, if not at least a trouble ticket system.
I know about these types of problems with script, I seem to find them all the time myself!