Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 01-02-2004, 02:03 PM   #1
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
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:
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
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 spaces before....nothing...
also try not to print the HTTP header, but use the following line:
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
Registered: Jan 2004
Location: Ontario, Canada
Distribution: Fedora
Posts: 4

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


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:04 PM.

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