views:

37

answers:

2

I just installed my system with Oracle 64-bit Linux5.4 running Apache Server version: Apache/2.2.3 and mod_perl 2.

Now, I have my Perl libraries set in a specific path: /my/perl/libs and I have adjusted my httpd.conf to compensate for this (I added the below):

SetEnv MY_LIBS /my/perl/libs

and in my CGI programs I'm setting my environment to compensate:

use lib($ENV{'MY_LIBS'});

Sometimes my Perl modules will recognize the path of /my/perl/libs and call all the functions appropriately, and sometimes they won't, thus thowing a 500 error.

When I restart apache (/etc/init.d/httpd restart), things work fine but then the 500 error comes up.

Are there any ideas? What should I be looking at?

A: 

You can't just 'use lib' in a mod_perl2 script. You need to either create a 'startup.pl' script with the needed 'use lib' or add a PerlSwitches option. See http://perl.apache.org/docs/2.0/user/config/config.html#Adjusting_C__INC

Benjamin Franz
A: 

I always put a block like this in my httpd.conf:

<Perl>
    use lib "/my/perl/lib";
</Perl>

I put that before any PerlModule or other perl-related config settings.

DougWebb