Happy New Year!
I have been using the GD.pm module (although this question applies to any such module) on my local server (WinXP, ActivePerl...PPM installation) for some time now and need to install it on my remote server. The remote server is linux and I do not have root access or telnet/command-line access. This obviously makes installing any perl module that requires compilation quite tricky.
I have been trying to use CPAN.pm through its programming interface as a possible solution. This is recommended from literature I have read but I can't seem to make it work.
Firstly, the literature:
http://search.cpan.org/~andk/CPAN-1.80/lib/CPAN.pm#FAQ - see point 5
http://sial.org/howto/perl/life-with-cpan/non-root/ - some more on this subject
I've tried to use this information but obviously it is designed for someone with command-line access.
My code:
In particular, line 4 seems dodgy. This is my reckoning of % echo '$CPAN::Config={ };' > $HOME/.cpan/CPAN/MyConfig.pm from the CPAN notes above. Note the absolute path.1 #! /usr/bin/perl -w 2 3 use CPAN; 4 CPAN::Config='EDITED FOR SECURITY PURPOSES'; 5 6 print "Content-type: text/html\n\n"; 7 my $mod = 'GD'; 8 print "Working...<br>"; 9 10 my $obj = CPAN::Shell->expand('Module',$mod); 11 $obj->install; 12 print "<br>Finished";
Finally, the modified MyConfig.pm as explained in http://sial.org article. Again, my absolute paths feature, although I'm not sure if I've applied this correctly.
$CPAN::Config = { 'build_cache' => q[5], 'build_dir' => q[EDITED FOR SECURITY PURPOSES], 'cache_metadata' => q[1], 'cpan_home' => q[EDITED FOR SECURITY PURPOSES], 'dontload_hash' => { }, 'ftp' => q[/usr/bin/ftp], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gzip' => q[/usr/bin/gzip], 'histfile' => q[EDITED FOR SECURITY PURPOSES], 'histsize' => q[100], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[EDITED FOR SECURITY PURPOSES], 'lynx' => q[ ], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'makepl_arg' => q[PREFIX=~/ SITELIBEXP=~/lib/perl5 LIB=~/lib/perl5 I +NSTALLMAN1DIR=~/share/man/man1 INSTALLMAN3DIR=~/share/man/man3 INSTAL +LSITEMAN1DIR=~/share/man/man1 INSTALLSITEMAN3DIR=~/share/man/man3], 'ncftp' => q[ ], 'ncftpget' => q[ ], 'no_proxy' => q[], 'pager' => q[less], 'prerequisites_policy' => q[ask], 'proxy_user' => q[], 'scan_cache' => q[atstart], 'shell' => q[/bin/sh], 'tar' => q[/usr/bin/tar], 'term_is_latin' => q[0], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[http://cpan.llarian.net/], q[ftp://cpan.nas.nasa.gov +/pub/perl/CPAN/], q[ftp://cpan.pair.com/pub/CPAN/], q[ftp://ftp.duke. +edu/pub/perl/], q[ftp://ftp.cs.colorado.edu/pub/perl/CPAN/], q[ftp:// +ftp.sunsite.utk.edu/pub/CPAN/], q[http://www.perl.com/CPAN/]], 'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]], 'wget' => q[/usr/bin/wget], }; 1; __END__
When I run my program, however, all I get is
Checking to see if the GD module has been installed, I find that it has not.Working... CPAN: Storable loaded ok
Any assistance would be appreciated. Thanks!
In reply to Remotely install modules by indiansummersky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |