Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Installing Modules on a Web Server

by adrianh (Chancellor)
on Nov 30, 2002 at 20:06 UTC ( #216683=note: print w/ replies, xml ) Need Help??


in reply to Installing Modules on a Web Server

Not everybody has the module files living in /lib. For example, my own Test::Exception has Exception.pm at the top level.

Rather that figuring out where the module lives it's easier to let perl find it for you.

  1. Create a local ~/tmp-lib directory
  2. Download and uncompress the module
  3. Do:
    perl Makefile.PL PREFIX=~/tmp-lib make make test make install

You should then find your module installed in ~/tmp-lib and can copy it to your web site as you described. You also get the advantage of running the test scripts.

If you are installing multiple modules, just repeat the make process. Everything will be installed into ~/tmp-lib and you can copy everything in one go.

Finally, if you are installing multiple modules that are dependent on each other you might want to do:

perl Makefile.PL PREFIX=~/tmp-lib LIB=~/tmp-lib

This will allow the module you are installing to find the other modules in ~/tmp-lib and run in a sensible way.


Comment on Re: Installing Modules on a Web Server
Select or Download Code
(tye)Re: Installing Modules on a Web Server
by tye (Cardinal) on Dec 01, 2002 at 05:17 UTC

    Or just skip the "PREFIX=..." and "make install" and upload both blib/lib and blib/arch to your perl-modules subdirectory (preserving subdirectory structure). That is, any file or subdirectories directly in blib/lib or blib/arch should go directly into your .../lib directory.

    Also "make test" implies "make" so you can do just:

    perl Makefile.PL make test
    Also, it is best to be sure your perl-modules directory (for example, /www/lib in the original node) is not being published by the web server. Even a "permission denied" response is not as good as just having that directory outside of the directories that your web server even looks at.

            - tye
Re 2: Installing Modules on a Web Server
by Anonymous Monk on Sep 02, 2004 at 21:11 UTC
    Finally, if you are installing multiple modules that are dependent on each other you might want to do:
    perl Makefile.PL PREFIX=~/tmp-lib LIB=~/tmp-lib
    This will allow the module you are installing to find the other modules in ~/tmp-lib and run in a sensible way.
    Actually, this didn't work for me. The modules couldn't find each other in this custom lib. I was trying to install CGI::Application which looks for HTML::Template. Neither of these were installed on my server. So I installed HTML::Template to my private lib. Then when I tried to install CGI::Application it couldn't see HTML::Template.

    Edited by Chady -- added <blockquote> to quoted text.

      Actually, this didn't work for me.

      Can you show what you typed in and what errors you got? AFAIK the PREFIX and LIB technique should work.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://216683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-11-28 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (198 votes), past polls