On 31/05/06, David Power <dlpower at epoc.ie> wrote:
> I have a problem getting perl to work with apache. I have
> googled and can get no solution.
You don't say how you got php to work. Is the problem "perl", or "cgi"?
Try the following as "env.cgi" and see what it produces:
echo Content-type: text/plain
>http://localhost/printenv.pl gives me:
> <h1>Internal Server Error</h1>
> <p>The server encountered an internal error or
> misconfiguration and was unable to complete
> your request.</p>
> <p>Additionally, a 500 Internal Server Error
> error was encountered while trying to use an ErrorDocument to handle the
Note that there are two errors reported there; you'll probably want to
fix both of them.
> running perl /var/www/html/printenv.pl as user outputs all the env
> variables in plain text
What does running
output? And when you do it as the same user that apache is configured
to run cgi scripts as? And when you do it in the same environment that
Trailing characters on the shebang line is one possibility. suexec and
SELinux are others.
Are either in use on your server?
> Examining the apache logs gives:
>> (13) Permission denied: exec of '/var/www/html/printenv.pl'
> Premature end of script headers: printenv.pl
That says that apache did not successfully run the script. The above
tests will show if you can run the script in the same way that apache
is trying to. If you have an suexec log file, there might be secrets
revealed there too.
> What have I done wrong? Could anyone help me out .
If these checks give no hints, then pointers to config files and
loaded or builtin modules and version numbers will probably be useful.
All the best,
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!