[CPANEL-23475] 3rd Party Perl Module Install Location
When installing Perl modules to be used by cPanel's 3rd Party Perl, I use the following command:
/usr/local/cpanel/3rdparty/perl/524/bin/cpan -i List::Compare
However, the modules get installed here:
# perldoc -l List::Compare
/home/user/perl5/lib/perl5/List/Compare.pm
Why is that? I get errors when trying to run a script, e.g.:
Can't locate List/Compare.pm in @INC (you may need to install the List::Compare module) (@INC contains: /home/user/scripts/../perl/Modules /home/user/perl5/lib/perl5 /home/user/perl5/lib/perl5/x86_64-linux-thread-multi /home/user/perl/usr/local/cpanel /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib/x86_64-linux-64int /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1/x86_64-linux-64int /home/user/perl/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1 /home/user/perl/opt/cpanel/perl5/524/site_lib/x86_64-linux-64int /home/user/perl/opt/cpanel/perl5/524/site_lib /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1 /opt/cpanel/perl5/524/site_lib/x86_64-linux-64int /opt/cpanel/perl5/524/site_lib) at /home/user/scripts/files_compare.pl line 23.
BEGIN failed--compilation aborted at /home/user/scripts/files_compare.pl line 23.
How can I get the modules to install in a location that the 3rd party Perl knows about?
Thanks,
Frank
-
Hello Frank, The following documents include information about using Perl in the cPanel environment: Guide to Perl in cPanel - Perl Environments - Software Development Kit - cPanel Documentation Prepare Perl Scripts for Our Internal Perl - cPanel Knowledge Base - cPanel Documentation What shebang are you using at the beginning of your Perl script? Additionally, note the following quote from our Documentation: [QUOTE]cPanel wants to ensure that we ship the modules that developers need. If you discover that cPanel & WHM does not ship with a CPAN module that you need, send an email to integration@cpanel.net to request it.
Thank you.0 -
This is the shebang I'm using: #!/usr/local/cpanel/3rdparty/bin/perl The weird thing about what I posted above is that "/home/user/perl5/lib/perl5" shows as being included in @INC in the error message, so why would pushing it onto @INC solve the problem? That 2nd link you posted says: "Install custom modules for this Perl environment into the /opt/cpanel/perl5/524/site_lib directory." Shouldn't that command install modules there on it's own, or do I need to add a path to that directory? /usr/local/cpanel/3rdparty/perl/524/bin/cpan -i Module::Name I would think that using that command, the modules would automatically be usable by that version of Perl without have to append to @INC. Thanks for the help, Frank 0 -
Hello, Could you open a support ticket using the link in my signature so we can take a closer look? Thank you. 0 -
Hello, I am facing the same questions - can you share what you discovered? I am attempting to install Linode's Longview monitoring client on a CPanel/WHM 74 CentOS 6.10 server. It is a perl script, and it will not run using the system perl (the script shebang is #!/usr/bin/env perl). It fails with: 11/07 07:53:05 INFO Longview[19190] - 500 Can't connect to longview.linode.com:443 (Network is unreachable) 11/07 07:53:05 INFO Longview[19190] - Can't connect to longview.linode.com:443 (Network is unreachable) LWP::Protocol::https::Socket: connect: Network is unreachable at /usr/local/share/perl5/LWP/Protocol/http.pm line 47.
I can reach that host with curl just fine, so I don't believe it is actually a firewall/network problem. Linode support suggest it is the system's old version of perl (5.10.1), so I am trying to use the more up to date 3rd party version (5.26) which is also installed. I modified the script shebang to use the 3rd party perl (#!/usr/local/cpanel/3rdparty/bin/perl), but now it fails bcs it is missing modules:Starting longview (With Debug Flag): Can't locate Log/LogLite.pm in @INC (you may need to install the Log::LogLite module) (@INC contains: /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0 /opt/cpanel/perl5/526/site_lib/x86_64-linux-64int /opt/cpanel/perl5/526/site_lib /opt/linode/longview/Linode/../ /opt/linode/longview/Linode/../lib/perl5 /opt/linode/longview/Linode/../lib/perl5/x86_64-linux-64int/ /opt/linode/longview/Linode/../usr/include) at /opt/linode/longview/Linode/../Linode/Longview/Logger.pm line 10.
/opt/cpanel/perl5 does not exist, so there are certainly no modules in /opt/cpanel/perl5/526/site_lib - it looks like there are no modules installed for this 3rd party 5.26 Perl? I found0 -
Hello @dont_panic, This topic was recently brought up as part of internal case CPANEL-23475. It was determined that the best approach to install modules for cPanel's Perl version is by using cpanm. For example: /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/bin/cpanm Log::LogLite
We have a documentation case open (DOC-11763) to ensure the existing document on this topic is updated to reflect this information. Can you let me know if using the above command helps? Thank you.0 -
Thanks for the reply. I can confirm that command worked, and installed modules to /opt/cpanel/perl5/526/site_lib. The longview script now generates a different error, so I assume that means it can find the newly installed Log::LogLite module, so I think that part is a success, thank you. [Moved separate issue to a new thread at ] 0 -
Hello dont_panic, I'm glad to see that helped. I moved the additional question to it's own thread at: Thanks! 0
Please sign in to leave a comment.
Comments
7 comments