LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   CGI Error (https://www.linuxquestions.org/questions/programming-9/cgi-error-130913/)

linux_monkey 01-02-2004 02:03 PM

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?

poison 01-02-2004 03:20 PM

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 ^^

linux_monkey 01-02-2004 03:29 PM

Thanx for your help.


All times are GMT -5. The time now is 09:19 AM.