As with many people whose sites are hosted on shared servers, I do not have root access, and the hosting company will not install Perl modules at the request of users.
Unfortunately, I also do not have write privileges to the ~/
folder, only to certain subfolders (such as ~/cgi-bin/
).
I've attempted the solution suggested here, changing ~/perl5
to ~/cgi-bin/perl5
(which I created), but I keep getting this error:
"Can't write to cpanm home '~/.cpanm': You should fix it with chown/chmod first."
The problem is, as I stated, I don't have write privileges to ~/.
Is there some way to tell the installer to use ~/cgi-bin/.cpanm
instead? I've tried to figure it out by searching on here and elsewhere on the internet, but I'm starting to bash my head against the wall.
EDIT : So I've tried the suggestion by Steven below, using this command:
HOME=$HOME/cgi-bin cpanm local::lib
Now, cpanm
successfully runs and tries to install the module, but has numerous warnings throughout the installation and ultimately fails (presumably something is still trying to write to a forbidden folder??).
Here are some sample warnings:
Warning: prerequisite CPAN 1.82 not found. We have 1.7601.
Warning: prerequisite ExtUtils::Install 1.43 not found. We have 1.32.
Warning: prerequisite ExtUtils::MakeMaker 6.42 not found. We have 6.17.
Warning: prerequisite Module::Build 0.36 not found.
Warning: You do not have permissions to install into /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi at /usr/lib/perl5/5.8.5/ExtUtils/Install.pm line 114.
mkdir /usr/lib/perl5/5.8.5/App: Permission denied at /usr/lib/perl5/5.8.5/ExtUtils/Install.pm line 176
make: *** [pure_perl_install] Error 255
~
is just a shorthand way of accessing the environment variable $HOME
, so you should be able to do something like export HOME=$HOME/cgi-bin
to move your effective home directory down into some directory you have write permissions for. This will affect many things, however, so be careful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With