jhill has asked for the wisdom of the Perl Monks concerning the following question:

I am currently trying to upgrade our websites which are hosted by webfusion. Our upgraded websites will implement session managment using Apache::Session. Since this module does not appear to be installed on the machine hosting our sites I have tried to copy the module source files to our own webspace. I have come up with the following software error;

Can't locate loadable object for module Storable in @INC (@INC contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at Apache/Session/Serialize/Storable.pm line 14 Compilation failed in require at Apache/Session/Serialize/Storable.pm line 14. BEGIN failed--compilation aborted at Apache/Session/Serialize/Storable.pm line 14. Compilation failed in require at Apache/Session/MySQL.pm line 22. BEGIN failed--compilation aborted at Apache/Session/MySQL.pm line 22. Compilation failed in require at session.pm line 46. BEGIN failed--compilation aborted at session.pm line 46. Compilation failed in require at user.pm line 53. BEGIN failed--compilation aborted at user.pm line 53. Compilation failed in require at main.pl line 59. BEGIN failed--compilation aborted at main.pl line 59.

What is a "loadable object" and how do I tell Perl where to find it?

Is there a better way to install modules to our own webspace?

Thanks
  • Comment on Installing modules in personal webspace

Replies are listed 'Best First'.
Re: Installing modules in personal webspace
by pelagic (Priest) on Mar 23, 2004 at 13:06 UTC
    try:
    use lib qw|/home/some/where|;
    Where "where" is where you put your source to.
    pelagic

    -------------------------------------
    I can resist anything but temptation.
Re: Installing modules in personal webspace
by simon.proctor (Vicar) on Mar 23, 2004 at 13:30 UTC
    Aside from using
    use lib
    with the correct paths, you need to ensure that all the prerequisite modules are also installed. A quick scan of this error log indicates that you will need Storable as well. If this isn't installed you will have to do it manually. You may also have to compile it if it contains XS code.
      I received the error message after manually installing Storable. How do I know if it contains XS code and how do I compile it?
        Well you can inspect the Makefile once generated or look at the README (though in this case it doesn't mention it). However, looking at the manifest for Storable it lists an XS file. That would be a good indicator that it will require a C compiler. To compile you will require console access to the server.

        To build it, simply do the old perl Makefile.PL, make, make install but you will have to change the installation point to be your home directory. I can't provide better instructions than those on this site so I suggest you super search around.
Re: Installing modules in personal webspace
by Callum (Chaplain) on Mar 23, 2004 at 13:09 UTC
    Most ISPs will have particular prefered ways for this to be done. You may wish your first port of call to be Webfusion's tech support.
Re: Installing modules in personal webspace
by kiat (Vicar) on Mar 23, 2004 at 16:00 UTC
    I'm chipping in to share my sentiment on perl modules.

    How I wish every perl module is self-contained so that you can copy and paste the code for the required module and upload it to your desired directory in the server.

    That way, you need not worry about whether the hosting company is going to install it for you. A case in point are modules like CGI::EncryptForm and CRYPT::HCE_SHA. If your webhosting company has them, all the better. If not, you have the option tocopy-paste the code and save it into your desired directory (correct me if I'm wrong).

      Most pure Perl modules work just like that. Copy the source files to the right location in any directory in @INC and the module will get loaded. It doesn't matter if that is /usr/lib/perl5/site_perl, /home/foo/perl/lib, or "../lib".

      Storable is a binary extension. It has a dynamic library that needs to be loaded. The building and placement of those is more particular. It is still possible to install binary extensions in a personal directory. It is more difficult to build the library on another machine because the build environment needs to be the same.

      That's foolish sentiment common among cash-strapped-juveniles.
Re: Installing modules in personal webspace
by BUU (Prior) on Mar 23, 2004 at 23:46 UTC
    Most perl modules are "Plain Perl" and to use them the interpreter simply reads in the .pm file as it would any .pl script. However, certain modules require extended functioanlity through the use of .xs, which is basically C code. This C code gets compiled to a dynamic library and then used by the interpreter. This compiled library is what perl refers to as the "loadable object".