Home > Archive > PERL CGI Beginners > May 2004 > Installing modules on shared server
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Installing modules on shared server
|
|
|
| I need to install two modules (LWP and Mime::Lite) in my area on a shared
server where I do not have root access. The instructions in the CPAN FAQ
say:
"You will have to add ~/myperl/man to the MANPATH environment variable"
How do I add something to the MANPATH environment variable (remembering I
am not root)?
Thanks for any help.
Derf
The full text of CPAN FAQ item I am quoting is:
Q: I am not root, how can I install a module in a personal directory?
You will most probably like something like this:
o conf makepl_arg "LIB=~/myperl/lib \
INSTALLMAN1DIR=~/myperl/man/man1 \
INSTALLMAN3DIR=~/myperl/man/man3"
install Sybase::Sybperl
You can make this setting permanent like all o conf settings with o conf
commit.
You will have to add ~/myperl/man to the MANPATH environment variable and
also tell your perl programs to look into ~/myperl/lib, e.g. by including
use lib "$ENV{HOME}/myperl/lib";
or setting the PERL5LIB environment variable.
Another thing you should bear in mind is that the UNINST parameter should
never be set if you are not root.
| |
| Sherm Pendley 2004-05-22, 11:32 am |
| Derf wrote:
> How do I add something to the MANPATH environment variable (remembering I
> am not root)?
Well, to begin with, MANPATH specifies where 'man' will look for man pages,
so it really only needs to be added if you intend to use 'man' to read the
docs for the module you install.
How to add it depends on the shell you're using. Many Linux systems default
to bash - for that, you'd edit (or create) ~/.profile, and add the
following line:
MANPATH=$MANPATH:~/myperl/man
export MANPATH
See the man page for your shell if you're using a different one. If you're
not certain what one you're using, use 'echo $SHELL' to find out.
> use lib "$ENV{HOME}/myperl/lib";
Finally, keep in mind that, if you're writing a CGI script, it won't have
the same HOME directory as you do when you're logged in. So, you'll need to
spell out the full path here, instead of relying on $ENV{HOME}.
> or setting the PERL5LIB environment variable.
Same thing applies here - setting this variable in your login environment
won't effect CGI scripts. In addition, if you set it in ~/.profile (or the
equivalent for your shell), it won't effect scripts scheduled with cron.
So for anything other than scripts you intend to log in and run manually,
it's best to use 'use lib'.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
|
|
|
|
|