perlrheltwiki

Why TWiki can't locate a module that is already in the @INC?


recently I was installing some perl modules on my RHEL 5 with perl version 5.8.8 and all instalations went fine. I can see that the modules exist in the @INC but my TWiki site claims that it can't find them returning an error: Can't locate Net/LDAP.pm in @INC (a lot of paths which contain the modules) at TWiki.pm line xx. When I do perl -e 'use Net::LDAP'; it doesn't return anything which means perl can find that module. Also TWiki was configured corectly and works fine except the plugins that use specific modules I had to install, I've even added the paths to setLib.cfg just in case.

Edit:

which perl returns /usr/bin/perl

the shebang line of twiki/cgi-bin/view is #!/usr/bin/perl -wT

perl -MNet::LDAP -e 'print $INC{"Net/LDAP.pm"}, "\n";' returns:

/usr/lib/perl5/site_perl/5.8.8/Net/LDAP.pm

apache error logs show: [Tue Nov 16 10:53:47 2010] [error] [client 10.76.14.170] [Tue Nov 16 10:53:47 2010] view: INC /usr/lib/perl5/site_perl/5.8.8 at /usr/local/apache2/htdocs/twiki5_pdc/bin/view line 44. So it use's the correct path.


Solution

  • Ok the reason was most probably that I was installing the perl modules as root and they were not set executable for others so apache couldn't execute/use them.