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

I recently installed some perl modules on my RHEL 5 with perl version 5.8.8, and all installations went fine. I see that the modules exist in @INC, but my TWiki site claims that it cannot find them that return an error: cannot find Net / LDAP.pm in @INC (many paths containing modules), on the TWiki.pm line xx. When I do perl -e 'use Net::LDAP';, it does not return anything, which means that perl can find this module. TWiki was also configured differently and works fine, except for plugins that use certain modules that I had to install, I even added paths to setLib.cfg just in case.

Edit:

which perl returns /usr/bin/perl

shebang line twiki/cgi-bin/viewequals#!/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

The 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.Thus, it uses the correct path.

+3
source share
5 answers

Well, probably the reason is that I installed perl modules as root, and they were not installed executable for others, so apache could not execute / use them.

+1
source

@INC may be different from your command line - either because you are using a different Perl interpreter, or other factors affecting@INC .

Check the command line @INC: perl -e 'print join(",", sort @INC);'- and compare with the @INCone printed in the Wiki error you specified.

, - Perl @INC, ( "" , mod_perl ).

+4

Apache INC- Perl , INC . , PERL5LIB Apache.

TWiki/FOSwiki .

+3
  • ( ):

    perldoc -l Net::LDAP
    

    POD, .pm. , .pod, .pm .

  • @INC( , . , , , Apache, , , .


, :

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

perl , , .

+2

: , , ?

: bin/twiki_cgi $TWiki:: engine- > run():

warn "ENV $_ => $ENV{$_}" for sort keys %ENV;
warn "INC $_" for @INC;

grep apache ENV INC. ENV PERL5LIB PERLLIB. INC, , , CPAN, .

+1

Source: https://habr.com/ru/post/1774126/


All Articles