LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-02-2004, 02:03 PM   #1
linux_monkey
Newbie
 
Registered: Jan 2004
Location: Ontario, Canada
Distribution: Fedora
Posts: 4

Rep: Reputation: 0
CGI Error


I am running an apache server with cgi enabled. I put ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/ in to my httpd.conf file.
I am just trying to run this script:
Content-type: text/html
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";


But when ever I run the script it gives me this error:
Premature end of script headers: first.pl.
I've read through the apace cgi tutorial but that didn't help at all. Does any one know what this error means?
 
Old 01-02-2004, 03:20 PM   #2
poison
Member
 
Registered: Dec 2003
Location: Layer 7 =D
Distribution: Slackware, LFS, Rock Linux
Posts: 165

Rep: Reputation: 30
the shebang line is hopefully the first line in your script ? it has to be.....no spaces before....nothing...
also try not to print the HTTP header, but use the following line:
Code:
use CGI qw(:standard);
if that still doesnt work, look at the apache error logs, they contain the most usefull infos what went wrong ^^
 
Old 01-02-2004, 03:29 PM   #3
linux_monkey
Newbie
 
Registered: Jan 2004
Location: Ontario, Canada
Distribution: Fedora
Posts: 4

Original Poster
Rep: Reputation: 0
Thanx for your help.
 
  


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
Perl-CGI 500 Error tzarcone Programming 1 07-01-2005 02:45 AM
RH 8.0 CGI 500 error (apache) 3Dxx Linux - General 46 06-27-2005 05:51 AM
cgi error niranjan_mr Linux - Software 2 03-25-2005 05:25 PM
Apache and cgi 403 Error. tethysgods Linux - Software 2 08-30-2004 09:06 AM
cgi error in from apache nrmx Linux - Software 1 05-02-2003 07:54 AM


All times are GMT -5. The time now is 04:53 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