Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: apache2 passing PERL5LIB environment to cgi

by rowdog (Curate)
on Jun 15, 2010 at 18:29 UTC ( #844907=note: print w/ replies, xml ) Need Help??


in reply to apache2 passing PERL5LIB environment to cgi

SetEnv should work fine as long as your server has mod_env enabled. If not, there are other ways to set environment variables in Apache.

In the unlikely case that $HOME actually exists, it will most likely be useless since it would probably refer to ~apache and not ~you. I suppose that mod_suexec might be able to make it your $HOME again, but that's a lot of work for little gain.

You might have a problem with permissions. For Apache to be able to read your files, you have to grant permissions for others to read. Maybe it's as simple as chmod o+x perl5lib. You can check if Apache can read the dir with a simple cgi that includes something like

#!/usr/bin/perl -T print "Content-type: text/plain\n\n"; print "PERL5LIB is $ENV{PERL5LIB}\n" -X $ENV{PERL5LIB} and print "Apache can read $ENV{PERL5LIB}\n";

If all else fails, use lib should do the trick, so I'd bet on a permissions problem.

Update: made script useable.


Comment on Re: apache2 passing PERL5LIB environment to cgi
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://844907]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-08-30 12:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls