You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Igor Vylusko <ve...@aha.ru> on 2002/11/27 10:14:15 UTC

Apache::Reload and @INC

Hi All,

in doc
http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
declared that when using Apache::Reload I may define additional lib
in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
But when I enable PerlInitHandler Apache::Reload in config all libs defined in
PERL5LIB are gone away from @INC.
I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
in VirtualHost sections.
I have bulk of VirtualHosts and would like make @INC different for each
one(i.e. not use lib ... in startup.pl).

Has anybody run across this problem?
If so....what is my solution?

Thanks a lot,
Igor.


Re: Apache::Reload and @INC

Posted by Stas Bekman <st...@stason.org>.
Igor Vylusko wrote:
>>>in doc
>>>http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
>>>declared that when using Apache::Reload I may define additional lib
>>>in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
>>>But when I enable PerlInitHandler Apache::Reload in config all libs defined in
>>>PERL5LIB are gone away from @INC.
>>>I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
>>>on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
>>>in VirtualHost sections.
>>>I have bulk of VirtualHosts and would like make @INC different for each
>>>one(i.e. not use lib ... in startup.pl).
>>
> 
> SB> It's not easy with mod_perl 1.0. The manpage is talking about changing 
> SB> @INC globally for the whole server. I usually do that with 'use lib' in 
> SB> startup.pl.
> 
> I define PerlSetEnv PERL5LIB globaly for the whole server but PERL5LIB
> was stripped out from @INC anyway on enabling PerlInitHandler Apache::Reload
> in _any_ vhost.
> I am using PerlSetEnv PERL5LIB per vhost basis and it works fine for me
> without Apache::Reload.

I can't reproduce what you see with Apache::Reload and I don't see 
anything in the code that mangles @INC.

Though what I do see, is that if you define PERL5LIB outside a 
VirtualHost, it overrides any PERL5LIB defined inside all VirtualHosts, 
no matter if you use Apache::Reload or not. I don't remember if that's 
how it should be or whether it's a bug. Those who use vhosts can 
probably help rectify the issue here.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re[2]: Apache::Reload and @INC

Posted by Igor Vylusko <ve...@aha.ru>.
>> in doc
>> http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
>> declared that when using Apache::Reload I may define additional lib
>> in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
>> But when I enable PerlInitHandler Apache::Reload in config all libs defined in
>> PERL5LIB are gone away from @INC.
>> I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
>> on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
>> in VirtualHost sections.
>> I have bulk of VirtualHosts and would like make @INC different for each
>> one(i.e. not use lib ... in startup.pl).

SB> It's not easy with mod_perl 1.0. The manpage is talking about changing 
SB> @INC globally for the whole server. I usually do that with 'use lib' in 
SB> startup.pl.

I define PerlSetEnv PERL5LIB globaly for the whole server but PERL5LIB
was stripped out from @INC anyway on enabling PerlInitHandler Apache::Reload
in _any_ vhost.
I am using PerlSetEnv PERL5LIB per vhost basis and it works fine for me
without Apache::Reload.

>> Has anybody run across this problem?
>> If so....what is my solution?

SB> There are several solutions, none of which is very helpful in 
SB> production, since they either slow things down or may cause collisions 
SB> when modules with the same names are loaded, see:
SB> http://perl.apache.org/docs/1.0/guide/config.html#Is_There_a_Way_to_Modify__INC_on_a_Per_Virtual_Host_or_Per_Location_Basis_

I would like just set PerlInitHandler Apache::Reload on several vhosts
only for developing purposes and preserve everything else at that.

Thanks for advice,
Igor.


Re: Apache::Reload and @INC

Posted by Stas Bekman <st...@stason.org>.
Igor Vylusko wrote:
> Hi All,
> 
> in doc
> http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
> declared that when using Apache::Reload I may define additional lib
> in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
> But when I enable PerlInitHandler Apache::Reload in config all libs defined in
> PERL5LIB are gone away from @INC.
> I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
> on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
> in VirtualHost sections.
> I have bulk of VirtualHosts and would like make @INC different for each
> one(i.e. not use lib ... in startup.pl).

It's not easy with mod_perl 1.0. The manpage is talking about changing 
@INC globally for the whole server. I usually do that with 'use lib' in 
startup.pl.

> Has anybody run across this problem?
> If so....what is my solution?

There are several solutions, none of which is very helpful in 
production, since they either slow things down or may cause collisions 
when modules with the same names are loaded, see:
http://perl.apache.org/docs/1.0/guide/config.html#Is_There_a_Way_to_Modify__INC_on_a_Per_Virtual_Host_or_Per_Location_Basis_
_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/