develooper Front page | perl.perl5.porters | Postings from April 2007

Re: [perl #42442] SetEnv in httpd.conf fails (corrected)

Thread Previous
Dominic Dunlop
April 11, 2007 02:38
Re: [perl #42442] SetEnv in httpd.conf fails (corrected)
Message ID:
On 2007–04–11, at 09:06, (via RT)  
> A call from httpd.conf fails to direct requests to the proper  
> directory:
> 	 SetEnv PERL5LIB /home/kohadan/public_html/koha/intranet/modules/
> A symbolic link in any of the @INC perl directories works  
> (redirects request to proper perl scripts) except that limits me to  
> one installation of this particular package; I need to run multiple  
> instances, all with their own SetEnv paths. A config test of  
> httpd.conf passes. mod_env is a loaded module in apache.

At first sight, this looks like a problem with Apache, rather than  
with Perl: as <>  
shows, mod_env is part of the Apache suite, and is written in C. See  
<> for information on what to  
do if you suspect a problem with httpd.

If Apache's not the problem, maybe it's mod_perl, which is not among  
the core modules that form a part of the Perl distribution. This  
means that you should see < 
mod_perl-1.30/SUPPORT> for information on pursuing any issues you may  
have. Note that the mod_perl FAQ suggests an alternative way to get  
at non-standard module directories: < 

If you can show that a Perl script is seeing the expected PERL5LIB at  
start-up (for example, by putting something like

BEGIN{print STDERR "$0: PERL5LIB=$ENV{PERL5LIB} ", join ":", @INC, "\n"}

right at the top), yet is not finding modules that it should, please  
get back to us.

A point to be aware of in software like Apache where the perl  
interpreter runs persistently so as to avoid start-up penalties is  
that a script won't see environment changes made after the  
interpreter has started; you need to restart httpd to make any  
changes visible. This is a consequence of the way environments work:  
when a process is started, the then-current environment is copied  
into its private address space where (modulo debuggers and such) no  
external process can affect it thereafter.
Dominic Dunlop

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About