[Catalyst] problem with Apache and FastCGI

Robert Wohlfarth rbwohlfarth at gmail.com
Mon May 28 00:55:37 GMT 2012


On Sun, May 27, 2012 at 6:36 PM, Luis Mu=F1oz <luisemunoz at gmail.com> wrote:

> Write a small cgi script that dumps the environment and take a look. You
> might be surprised
>

I'll second that. There is a really good chance that Apache is not giving
your script the same environment as the shell. And that is why can't find
Perl.

Here's a snippet about environment variables from the Apache documentation
on CGI:
Path information and environment

When you run a program from your command line, you have certain information
that is passed to the shell without you thinking about it. For example, you
have a PATH, which tells the shell where it can look for files that you
reference.

When a program runs through the web server as a CGI program, it may not
have the same PATH. Any programs that you invoke in your CGI program (like
sendmail, for example) will need to be specified by a full path, so that
the shell can find them when it attempts to execute your CGI program.

A common manifestation of this is the path to the script interpreter (often
perl) indicated in the first line of your CGI program, which will look
something like:

#!/usr/bin/perl

Make sure that this is in fact the path to the interpreter.

In addition, if your CGI program depends on other environment
variables<http://httpd.apache.org/docs/2.0/howto/cgi.html#env>,
you will need to assure that those variables are passed by Apache.
-- =

Robert Wohlfarth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120527/2c4e3=
cfd/attachment.htm


More information about the Catalyst mailing list