Skip to main content
Hosting How-To

How to install Perl modules on shared servers – Hosting

By May 22, 2021No Comments

A Perl module is a discrete component of software program for the Perl programming language. Perl is supported on all of our Shared/Reseller servers and the Perl Modules menu is obtainable with Stellar In addition and Stellar Organization. Even so, when you try out to install a Perl module in the cPanel >> the Perl modules menu, you will encounter this error:

Most Perl modules are prepared in Perl, some use XS (they are created in C) so they involve a C compiler. On the other hand, C compiler is disabled on all of our shared servers as it is a significant stability menace.

Even now, it is possible to put in any Perl module via the command line without having C compiler enabled. You can do it employing the SSH relationship, the guide on how to entry your account by means of SSH can be observed listed here.

&#13
1. Right after opening the command console, you have to have to sort cpan. This way, you will accessibility the cpan console:

2. The syntax is the subsequent:

put in module::title

For illustration, we will put in the Day::Calc Perl module:

3. Most very likely, you will see this mistake message at the conclusion:

Cpan is configured to supply a single environment to Makefile.PL, and Makefile.PL is&#13
choosing up a conflicting location from the natural environment.&#13

Cpan Prefix is pre-configured as PREFIX=/home/Consumer/perl/usr

Even so, our servers’ ecosystem is configured to use /house/Person/perl5&#13

As this kind of, simply just explain to cpan to quit specifying PREFIX. From within just the cpan&#13
shell, run these instructions:

o conf makepl_arg ''

o conf mbuildpl_arg ''

o conf commit

o conf make_arg ''

o conf commit


&#13
4. Now really feel free to operate set up module::identify when once again.&#13
In circumstance you see an error like under, you have to have to delete the former failed establish and consider once more:&#13

In our instance, the error shows listing /dwelling/nctests/.cpan/construct/Date-Calc-6.4-hsg6j9
&#13
You can entry it by means of the cPanel File Supervisor or using an FTP customer and delete it:&#13

5. This is a prosperous installation log:

Modules may well have dependencies on other modules (virtually generally on CPAN) and are not able to be set up with out them (or without the need of a particular edition of them).&#13

At times, the installation will check with to install a module (or a few kinds), which has/have a dependence.&#13

6. Following the installation do not neglect to sort exit in the cpan console to shut it and take out the lock file:

Otherwise, you may see this message soon after attempting to open up it all over again:

Just after Shall I try out to operate in downgraded method? (Y/n), sort n and stick to the directions.&#13
You will need to kill a jogging cpan procedure and distant the lock file manually:

&#13
7. Eventually, you can open up the Perl Modules choice in cPanel and check for a new set up module.

Remember to Be aware: In purchase for the newly put in module to perform effectively, the pursuing lines should really be additional at the leading of your script:

#!/usr/bin/perl
use cPanelUserConfig

&#13
&#13
&#13
or

#!/usr/bin/perlml
The end users of Stellar Moreover and Stellar Organization internet hosting offers can discover these two possibilities in the Perl Modules menu:

We hope that this post will aid you setting up Perl modules on our servers.

That’s it!

Leave a Reply