in reply to Re: Dynamic @INC under mod_perl2 (Apache2 VirtualHost)
in thread Dynamic @INC under mod_perl2 (Apache2 VirtualHost)

Keeping in mind the important piece of info in the parent post is PerlOptions +Parent, the docs also say -Mlib=... is buggy on certain platforms. -I... does the same thing, except it doesn't remove duplicates (which is no biggy). Therefore, he should keep his -I... and simply add PerlOptions +Parent, as follows:

<VirtualHost ...> ServerName dev PerlOptions +Parent PerlSwitches -I/home/dev/lib/perl </VirtualHost> <VirtualHost ...> ServerName test PerlOptions +Parent PerlSwitches -I/home/test/lib/perl </VirtualHost>

I presume his LoadModule needs to be placed in <VirtualHost> for it to work?

Replies are listed 'Best First'.
Re^3: Dynamic @INC under mod_perl2 (Apache2 VirtualHost)
by graq (Curate) on Mar 29, 2006 at 09:07 UTC
    Thank you - I am making progress.

    I've setup Apache to listen on port 8080 and Included VH config file like so:

    But I get this error, despite my best efforts:
    Can't locate object method "log_error" via package "Apache2::RequestRe +c" at /home/graq/lib/GRAQ/Menu.pm line 56.

    This all used to work with liberal smatterings of <Perl> use lib 'home/graq/lib';</Perl> and I'm getting a little lost on exactly what effects my changes have had on the mod_perl environment.

    I remember having this error when porting from mp1 to mp2, but can't find any notes on it or hints from the docs on what object I should have in handler...?

    -=( Graq )=-
      Looking through the Apache2::RequestRec documentation shows that log_error actually exists on Apache2::Log (which extends Apache2::RequestRec).

      For whatever reason, that extension was not loaded with the new configuration. Adding use Apache2::Log; to my modules fixed the problem.

      Thank you all for your help

      -=( Graq )=-