LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 05-16-2004, 04:13 AM   #1
webhead
LQ Newbie
 
Registered: May 2004
Location: Phoenix, Arizona
Distribution: Redhat Linux 9
Posts: 5

Rep: Reputation: 0
Premature end of script headers


I just recently changed my server over from Windows 2000 to Redhat Linux 9. Now what I did was mount my old C drive in /mnt/windows and just used all the same stuff. I then copied the cgi-bin files to /var/www/cgi-bin. The problem now is that is keeps giving me that error "Premature end of script headers". Now, I tried the whole "#!/usr/bin/perl -w" thing, and it seemed to work, but in reality, the scripts did not actually worked, they simply stopped giving me errors. Does anyone have any idea what the problem might be? I don't have anything special going on with Apache, its basically just like it was when I installed it.

Hopefully someone can help me, I have been trying to fix this thing forever :-/
 
Old 09-18-2004, 06:13 PM   #2
webhead
LQ Newbie
 
Registered: May 2004
Location: Phoenix, Arizona
Distribution: Redhat Linux 9
Posts: 5

Original Poster
Rep: Reputation: 0
^bump^
I recently just installed RH9 on a different computer and am having the exact same problem. I messed with all KINDS of permissions and nothing will help. I ran the script from the command line, just for shits and giggles, and there are no errors there.

Someone please help me, is there some kind of daemon I need to be running, or some kind of program that I am forgetting to run? Is there something I need to add to my apache config file besides ExecCGI or Addhandler .cgi and .pl? ANY suggestions that ANYONE has would be GREATLY helpful.
 
Old 09-21-2004, 01:57 AM   #3
manvirr
Member
 
Registered: Jul 2004
Location: Chandigarh
Distribution: RedHat 9.0
Posts: 34

Rep: Reputation: 15
try copying the perl scripts under the /cgi-bin directory of your website. Or make changes in httpd.conf file to poing cgi-bin to the directory where your files are stored. In some cased apache has problems with file permissions too. So try copying the files into a ext2 / ext3 partition and pointing the cgi-bin to that directory. This should work.
 
Old 09-21-2004, 02:13 AM   #4
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,074

Rep: Reputation: 53
The Apache FAQ covers the "premature end of script headers" topic in detail. Various defects can be the cause, not limited to: Windows-specific line delimiters (run 'dos2unix' on the files), improper file permissions and ownership (read Apache's error and suexec log file).
 
Old 09-21-2004, 09:12 PM   #5
webhead
LQ Newbie
 
Registered: May 2004
Location: Phoenix, Arizona
Distribution: Redhat Linux 9
Posts: 5

Original Poster
Rep: Reputation: 0
Hey, thanks guys.

I eventually ended up searching as many sites as possible and eventually figured out that it was all that windows control code bullshit. Sheesh, I'm not even running windows on the box, but its still managing to screw things up.

That dos2unix thing converts files to Unix type right? That would be most helpful, I really dont want to open all my CGI scripts with NEdit and save them as unix. x_x
 
Old 09-22-2004, 01:56 AM   #6
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,074

Rep: Reputation: 53
Lines in DOS/Windows text files end with CR/LF (carriage return + line feed) ASCII control characters, while Unix/Linux lines end with just LF. MacOS text files end with just CR. Few applications are aware of that. The others fails upon reading in lines and stripping off the line delimiters.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Premature end of script headers: CGI fatturi Linux - Newbie 4 07-19-2007 04:55 PM
Premature end of script headers bhomass Debian 1 12-02-2005 05:31 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
Perl/CGI Problem "Premature Premature end of script headers: countdown.pl" newuser455 Linux - Software 2 07-18-2004 11:47 AM
Premature End of Script Headers (Error 500) bsdb3 Red Hat 5 05-06-2004 11:55 AM


All times are GMT -5. The time now is 11:23 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration