Problem with .htaccess and PERL5LIB


One of my websites uses a bunch of perl modules installed with cpan to ~/perlmods
I have been useing a .htaccess file to set PERL5LIB:
SetEnv PERL5LIB /home/wildlifedb/perlmods/lib/perl/5.10.0/:/home/wildlifedb/perlmods/share/perl/5.10.0/

For some reason this stopped working yesterday, I have not made any changes to the code for months and yesterday it stopped working and started generating the following error:
[Thu May 10 18:33:08 2012] [error] [client] Can’t locate in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at line 4.
[Thu May 10 18:33:08 2012] [error] [client] BEGIN failed–compilation aborted at line 4.
[Thu May 10 18:33:08 2012] [error] [client] Premature end of script headers:

It looks like the .htaccess is no longer getting read.


More likely suexec isn’t passing on PERL5LIB


I’m not too savvy with Perl, but with PHP, you can set those paths in the script itself. Perhaps try that?


Yeah, that’s what I’m doing for now, but for an app with 30+ files deployed in multiple environments under version control this is not a viable long term solution.

Re: suExec
That does seem like it could be what’s going on, but from what I’ve read it shouldn’t have ever worked. Maybe dreamhost was using a custom version of suExec that did pass perl5lib and just updated to a version that doesn’t?


That is, in fact, exactly what happened.


Any suggestions for a workaround other than specifying the library path in each file?


I’m thinking some kind of wrapper, ie that sets PERL5LIB first, but then you have to have that in your shebang line, which wouldn’t match what you might have for your local development machine.