This looks like another instance of the “CPAN installing modules per user rather than system wide” issue. I got bitten by this on CentOS 7 - yum wants to look after everything so they’ve set up CPAN to install for just the user running it, rather than all users. Which means modules “owned” by root won’t be visible in the Perl interpreter running in the web server.
You need to check the config of CPAN so that Perl modules installed via CPAN are put in a directory that every user (including the apache/httpd/www user) can see (probably something like /usr/local/lib64/perl5
looking at the libraries your Perl is checking in the error message you included).
As a hint, on CentOS 7 it tried to use local::lib
configured to put things in /root/perl5
. Check the /root/bashrc
to see if there are environment variables added for PERL_LOCAL_LIB_ROOT
, PERL_MB_OPT
, PERL_MM_OPT
, PERL5LIB
and PATH
that reference /root/perl5
. If so comment them out, log out of the root shell, log back in and try installing the module again.