uebel has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I'm trying to execute a cgi script but it fails with the following error:

Can't locate SNMP/Info.pm in @INC (@INC contains: ./modules /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at modules/GestioIP.pm line 17.

The system is a Red Hat Enterprise Linux Server release 6.6 (Santiago) - Linux 2.6.39-400.215.12.el6uek.x86_64 #1 SMP Wed Oct 29 17:37:57 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux

SELinux is disabled

SNMP::Info is installed under /usr/local/share/perl5/SNMP/Info.pm, which is included in Apache's @INC.

perl -e 'use SNMP::Info' doesn't have an output, meaning that Perl finds the module.

The cgi sript loads other modules without errors before Info.pm which have the same permissions as Info.pm

Does anyone have a suggestion where the problem might be?

Thanks a lot.

Replies are listed 'Best First'.
Re: Can't locate SNMP/Info.pm in @INC
by roboticus (Chancellor) on Feb 23, 2015 at 18:33 UTC

    uebel:

    I'd check permissions and paths: Your web server isn't running under your account (I would hope), so directory permissions and path settings are likely culprits.

    I'd first check the differences between your path and the one that the web server is running under. After that, I'd verify that the directory containing the SNMP library has appropriate permissions.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.