huklberry has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to setup the apache web server on a linux fedora platform. Everything seems to be working with the exception of executing a perl script when invoked from a webpage. Every time I try to execute my perl script from my webpage I get an "500 Internal Server Error" and the following error logs:
(13)Permission denied: exec of '/cgi-bin/test.pl' failed Premature end of script headers: test.pl
I've triple checked the permissions of the cgi-bin directory and the perl script and they look fine...
drwxr-xr-x 2 root root 4096 Jul 1 17:38 cgi-bin [root@localhost cgi-bin]# ll -rwxr-xr-x 1 root root 159 Jul 1 17:38 test.pl
I've verified the location of my cgi-bin directory is correct. When I remove test.pl I get a "404 Not Found" error instead of the server error. I also verified the script runs fine from the command line. My script is very basic and intended only to verify I can execute perl scripts. Code is below...
#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use strict; use warnings; print "Content-type: text/html\n\n"; print "testing testing\n"; exit;
Any thoughts on what I could be doing wrong would be greatly appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Premature end of script headers error
by imp (Priest) on Jul 02, 2006 at 01:20 UTC | |
by huklberry (Novice) on Jul 02, 2006 at 02:39 UTC | |
Re: Premature end of script headers error
by Zaxo (Archbishop) on Jul 02, 2006 at 01:11 UTC | |
by imp (Priest) on Jul 02, 2006 at 01:24 UTC | |
Re: Premature end of script headers error
by ioannis (Abbot) on Jul 02, 2006 at 02:48 UTC |