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

I am attempting to move my locally hosted site (which runs great) out to my externally hosted site. I have created a /lib folder in /cgi-bin and refer to the modules there by using "use lib "./lib". Unfortunately, I am getting errors that I just don't understand...well, I understand that it is looking for something and not finding it. I know that the use lib that I am using is valid since it appears that the problem is coming from within the /cgi-bin/lib/DBI.pm module.

Here's the poop I get in my err.log:

[Tue Jun 4 16:29:01 2002] content.pl: [Tue Jun 4 16:29:01 2002] DBI. +pm: [Tue Jun 4 16:29:01 2002] DBI.pm: [Tue Jun 4 16:29:01 2002] DBI +.pm: Can't locate loadable object for module DBI in @INC (@INC contai +ns: ./lib /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/l +ib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /u +sr/lib/perl5/site_perl .) at lib/DBI.pm line 234 [Tue Jun 4 16:29:01 2002] content.pl: [Tue Jun 4 16:29:01 2002] DBI. +pm: [Tue Jun 4 16:29:01 2002] DBI.pm: BEGIN failed--compilation abor +ted at lib/DBI.pm line 234. [Tue Jun 4 16:29:01 2002] content.pl: [Tue Jun 4 16:29:01 2002] DBI. +pm: Compilation failed in require at lib/DBI.pm line 28. [Tue Jun 4 16:29:01 2002] content.pl: BEGIN failed--compilation abort +ed at /home/httpd/www.shrum.net/cgi-bin/content.pl line 28.

Line 28 of content.pl is use DBI;

Any help getting this mess straightened out would be apprechiated.

======================
Sean Shrum
http://www.shrum.net

Edit by tye to change PRE tags to CODE tags

Replies are listed 'Best First'.
•Re: DBI ?...moving module files manually...no shell or telnet access
by merlyn (Sage) on Jun 05, 2002 at 00:34 UTC
    You can't just move DBI.pm around. It depends on a binary that gets installed and is specific to the particular version of Perl that is installed.

    You'll either have to get the admin to install it, or you'll need some sort of shell access. If neither of those are available, you're out of luck.

    -- Randal L. Schwartz, Perl hacker

      You'll either have to get the admin to install it, or you'll need some sort of shell access. If neither of those are available, you're out of luck.

      Not sure if your definition of 'shell access' extends beyond an interactive session with telnet or ssh, but in many cases, all you really need is the ability to execute arbitrary scripts on the target machine ... something you probably already have in the form of CGI!

      #!/bin/sh echo "Content-Type: text/plain" echo "" ( gzip -cd Module-2.1.tar.gz | tar xvf - cd Module-2.1 perl Makefile.PL LIB=~/lib make && make test && make install ) 2>&1

      Sure it can be a pain, but it works.

          --k.


        Let's see if I understand this...

        You're saying that I can write an install script that would take the tar.gz file and make (build) it on the host machine and install itself to a folder of my chosing? I'm assuming that I just d/l and copy the tar.gz into my cgi-folder so that the script can access it?

        This would be uber-kewl...if that is what you mean (and if I have access to do it). Can this be done with all modules?

        Otherwise, please slap me into place and lead me down the path of Perl module installation enlightenment.

        Much-o grass-y-ish

        ======================
        Sean Shrum
        http://www.shrum.net

      Not nessecarily true...

      I had posted these modules manually previously and had them working.

      Since then I have *updated* (upgrade -install) my modules locally and now have the problem on my external site after reposting them to the site.

      ======================
      Sean Shrum
      http://www.shrum.net

        You've never done that with DBI: I'd bet the rent money on it.

        Perhaps you're thinking of some other pure-perl module, but DBI from day one has always had a binary shared-object component to it.

        -- Randal L. Schwartz, Perl hacker

Re: DBI ?...moving module files manually...no shell or telnet access
by Steve_p (Priest) on Jun 05, 2002 at 00:52 UTC
    You need to use the full path to your library. So change your use lib to
    use lib "/home/foobar/cgi-bin/lib"
    where /home/foobar is the full path to your cgi-bin/ directory.