in reply to Re: CPAN PREFIX or INSTALL_BASE
in thread CPAN PREFIX or INSTALL_BASE

The question now is why cPanel does not allow you to install (some?) modules. Without me ever using cPanel or knowing what's going on in the mind of the hosting service I would guess that the answer is "because you can mess your system very easily". You see Perl is used for some of OS maintenance and if you even upgrade system Perl or a module that system Perl relies on to be on a particular version then some things may break.

cPanel prevents me from installing any modules...I used to be able to, but the powers-that-be decided to remove compiler access. I suspect it is partly to push people to upgrade to a less restrictive hosting package as much as for security reasons. cPanel installs the modules in a user directory, not in Perl's directories so it is not an admin concern. Indeed, to use modules that have been installed, this is from cPanel within the hosting:

Your Perl script needs to know how to find the modules in your path. You can do this by adding one of the two choices below to the top of your script:

#!/usr/bin/perl use cPanelUserConfig;
or
#!/usr/bin/perlml

Earlier today I installed local::lib on the suggestions of Corion which worked until I came to . ~/.bashrc which gave a "Permission denied" error. So I am rather restricted on what is possible! But, at least I now have a means of installing Perl modules without the support ticket lottery.

UPDATE:

I need to have use cPanelUserConfig; in place to be able to bring in a module that I have installed using CPAN instead of cPanel. However, that module doesn't appear in the list of installed modules displayed by cPanel.

Replies are listed 'Best First'.
Re^3: CPAN PREFIX or INSTALL_BASE
by bliako (Abbot) on Nov 25, 2020 at 00:36 UTC

    re: . ~/.bashrc permission denied: it's best to login/logout. But if you insist do this first: chmod 700 ~/.bashrc

    So I am rather restricted on what is possible!

    No! Don't forget: you (as root) are the most powerful user within the bytes and circuits you rented from them for as long as your credit flows. You can do anything (unless something changed in hosting when I looked away)

    Please take advice from other Monks on this one: All these use cPanelUserConfig; and especially #!/usr/bin/perlml seem to me to constrain you. For example, in future migrations to other hostings. Plus, when you ftp your code from home into the site you must then manually edit each and every script to incorporate these special headers. This is not practical (for me). So why don't you just re-install all your modules from commandline, try to replicate your home environment onto the host, and do without these use statements on each and every script/module ? Btw, when you are more confident command-line user can save some money if they charge for cPanel.

    Additionally using #!/usr/bin/perlml in a perl script which you execute, tells the shell that the script text which follows that *shebang line* should be interpreted (run through) the command /usr/bin/perlml . Which, I guess, is some perl the host installed to be compatible with cPanel module installations etc. Or, perhaps it's a shell script which sets various ENV vars in order for Perl to load modules from certain paths etc. If you are running a perl-based website you must control 100% the Perl version and the Perl modules. But again, I am not running a commercial website myself (a tiny one anyway which does not count), so please seek advice from other Monks more experienced with this situation.

    bw, bliako

      Btw, when you are more confident command-line user can save some money if they charge for cPanel

      They don't - at least not separately. Obviously their costs are charged to their customers.
      However, I understand cPanel are changing their pricing policy from per-server to pre-user which will make it more costly for shared hosting providers and therefore more costly for user of shared hosting who want cPanel.

      I personally have no attachment to cPanel...if I knew how to do everything I need to do without cPanel I would be perfectly happy without it. But when it comes to installing SSL certificates and other tasks I would not know where to start...but, slowly I am learning so perhaps my days with cPanel are numbered!

        But when it comes to installing SSL certificates ...

        oh not that :(