Premature end of script headers error- CGI

Stradlin

Member
Feb 27, 2000
60
0
0
I keep getting a "Premature end of script headers" error when trying to run CGI scripts on a new server that I've been transferring working files to. I can't even get it to print the header. I've CHMODded, I've uploaded in ASCII, the scripts are good, Perl is located in the indicated directory... Anyone? Please?
 

Need4Speed

Diamond Member
Dec 27, 1999
5,383
0
0
are you sure there are no carriage returns in the script? quite often when writing scripts on a windoze box and running them on a unix box there are hidden carriage returns that will kill the script.

edit: if you are running these scripts on a linux box, you may want to look into the dos2unix script which will remove carriage returns from dos files.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
First check the apache logs, they usually tell you exactly what the problem is especially with perl.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
try adding this on top:
#!/usr/bin/perl -w
use CGI::Carp qw(fatalsToBrowser);

see if you can see more error message (the 2nd line tells the interpreter to spit out the error to browser in addition to the apache log)