
Help:apache did not run perl script
I have had a similar problem myself the last two days, not with Perl but
with a C++ program.
Might be a bit basic, but it is worth checking out the obvious first.
Make sure you have your Apache server set up to run cgi scripts (in
/etc/httpd/conf/httpd.conf). Seems like you have got this working already
since you can access the script. I configured my Apache server to:
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
AddHandler cgi-script cgi
Also check you print out the following lines to standard out as the first
lines:
Content-type: text/html
<newline>
<newline>
It is imporant to have two newline lines after the Content-type.
Also make sure you do not send anything to standard out before the
"Content-type" line.
What about changing permission on your perl script so the web server can run
it ? Try "$chmod 777 perlscript.pl".
Do you have a line like "#! /usr/bin/perl" as the first line in your script
so the Web server knows to run the perl interpreter on the script ?
Hope this helps.
Arne