error: premature end of script headers in cgi
am 31.08.2004 16:47:44 von William Stanard
I'm running Linux 2.4.18-14smp on a Compaq Proliant. When trying to run
gm.cgi (correctly chmod-ed, I believe) to start using Greymatter blogging,
I receive the following error when I look at the httpd error_log:
[error] [client 10.0.4.126] Premature end of script headers: gm.cgi
I am guessing that in moving the cgi scripts to my Linux box via
Dreamweaver, I "added" some bogus carriage returns or some such... How can
I (first) see if that is what I did and (two) edit same...
Bill Stanard
Academic Computing
Palmer Trinity School
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: error: premature end of script headers in cgi
am 31.08.2004 23:04:02 von Peter Garrett
On Wed, 2004-09-01 at 00:47, William Stanard wrote:
>
> [error] [client 10.0.4.126] Premature end of script headers: gm.cgi
>
> I am guessing that in moving the cgi scripts to my Linux box via
> Dreamweaver, I "added" some bogus carriage returns or some such... How can
> I (first) see if that is what I did and (two) edit same...
Bill: I'm no expert, and perhaps someone more knowledgeable might be
able to explain better, but I believe your guess may be correct. The
carriage returns for DOS/Windows are different from those in UNIX (which
Linux more closely resembles, of course.)
The program you want is probably the command-line utility dos2unix.
Seems to be pretty standard on most Linux installations. From "man
dos2unix":
" tofrodos - Converts text files between DOS and Unix formats.
SYNOPSIS
fromdos [ options ] [file...]
todos [ options ] [file...]
DESCRIPTION
DOS text files traditionally have carriage return and line feed
pairs
as their newline characters while Unix text files have the line
feed as
their newline character. fromdos converts text files from the
DOS for-
mat to the Unix format, while todos converts text files from
the Unix
format to the DOS format. ...."
Hope this helps...
Peter
--
Windows belongs to Microsoft: Linux belongs to humanity
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: error: premature end of script headers in cgi
am 01.09.2004 00:02:53 von John Kelly
Hi,
On Tue, 31 Aug 2004 10:47:44 -0400
"William Stanard" wrote:
> I'm running Linux 2.4.18-14smp on a Compaq Proliant. When trying to
> run gm.cgi (correctly chmod-ed, I believe) to start using Greymatter
> blogging, I receive the following error when I look at the httpd
> error_log:
>
> [error] [client 10.0.4.126] Premature end of script headers: gm.cgi
>
> I am guessing that in moving the cgi scripts to my Linux box via
> Dreamweaver, I "added" some bogus carriage returns or some such...
> How can I (first) see if that is what I did and (two) edit same...
>
There are a few methods to see non printing characters in a file.
Try
cat -v filename
In vi, in command mode you can do:
: set list
and all the 'funny' characters will be displayed.
Do:
: set nolist
to make the file appear normal.
Personally whenever I come across an MS-dos file on Unix, I first
check it in vi with the :set list command and then I do a vi command
like:
:%s/vM//g
This is a substitute command.
The % sign means apply the command to the whole file
s means substitute.
/ is the delimiter
v means dont interpret the next keystroke
M is the 'funny' character you want to get rid of. In this case
it is control M, though you may find something else in your
particuliar file. g means do the command globally ie do it as many
times as necessary on each line.
Of course if it all goes wrong, you can type u in command mode and the
change will be undone :-)
Hope this helps.
regards,
John Kelly
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs