Forum Moderators: coopster & phranque

Message Too Old, No Replies

Bad Perl DBI module - how do I reinstall?

My DBI module for Perl is bad & I don't know how to fix it.

         

wholesteve

10:36 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



I've been trying desperately to install a CGI app (ClickCartPro 5.1) that uses a SQL database.

I kept encountering error messages that all the forums for the ClickCart said indicated a my server has bad DBI module. They all said the server admin should reinstall it. The problem is that I'm that admin, and, while I know how to deal with most of my server - I'm new to Perl ...And I need to start using this app asap.

Given some other variables that made me doubt how precise an error this was, I finally broke down and paid the developer to install it for me. He took care of any other issues, and still encountered the same problem as I did - this error message:

Can't locate loadable object for module DBI in @INC (@INC contains:
/Users/somatics/Sites/ccp51/cgi-bin/modules_lib
/System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin
/Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl .
/Users/somatics/Sites/ccp51/cgi-bin/modules_inc
/Users/somatics/Sites/ccp51/cgi-bin/modules_dbi) at
/Users/somatics/Sites/ccp51/cgi-bin/modules_dbi/DBI.pm line 255

----------------------

His note to me was:

This indicates the following:
The loadable object error is indicative of a bad DBI module on the
server.
I can make the script run in this environment but you will not be able
to use MySQL.

----------------------

He told me I need to deal with the bad DBI module. I've searched all over perl.com, Apple's support site, etc. places - and I can't find any actual explanation of what to download or where and where to install it.

Please help!

Thanks!

zCat

10:55 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



This is not a "bad" DBI module, whatever that means. This is a case of either a) the DBI module is not being found (it's directory isn't in Perl's @INC array which contains the list of directories to search for Perl modules); or b) the module is plain and simple not there.

You could definitively establish whether the module exists on the filesystem with a shell command like this (in the Terminal application):
find / -name DBI.pm -print

Unfortunately I'm not very familiar with Perl on Macs so don't know the best way to install a missing module though.

zCat

11:00 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



This link might be useful:
[softwaregarden.com...]

wholesteve

12:57 am on Mar 19, 2005 (gmt 0)

10+ Year Member



Thanks for your help with this. At the end of this post is what it found when I searched for DBI as per your suggestion. It seems to find it wherever I installed a Perl CGI (like MoveableType or ClickCartPro) or saved a copy somewhere.

Regarding your suggestion (b): But is that what I'm looking for? Or am I looking for it in some installed, operating systemwide Perl directory?

Regarding your suggestion (a): How do I put the directory in Perl's @INC array? Is that a file I need to open in BBEdit and add a line to? Or is there a program I need to run to update a directory? Where is the @INC array? Is it animal, vegetable, or mineral?

Here's the search results from Terminal:

root# find / -name DBI.pm -print
/private/var/root/.cpan/build/DBI-1.39/blib/lib/Bundle/DBI.pm
/private/var/root/.cpan/build/DBI-1.39/blib/lib/DBI.pm
/private/var/root/.cpan/build/DBI-1.39/DBI.pm
/private/var/root/.cpan/build/DBI-1.39/lib/Bundle/DBI.pm
/private/var/root/ccp51/cgi-bin/modules_dbi/lib/Bundle/DBI.pm
/private/var/root/ccp51 copy/cgi-bin/modules_dbi/DBI.pm
/private/var/root/DBI.pm
/Shared Items/applications_installed_masters/MT-3.121-full-en_us copy.121-full-en_us/lib/MT/ObjectDriver/DBI.pm
/Shared Items/applications_installed_masters/sw/lib/perl5/5.6.0/darwin/Bundle/DBI.pm
/Shared Items/applications_installed_masters/sw/lib/perl5/5.6.0/darwin/DBI.pm
/Shared Items/applications_installed_masters/sw/share/doc/dbi-pm560/DBI.pm
/Shared Items/applications_installed_masters/sw/src/time-hires-pm560-1.42-2/Time-HiRes-1.42/DBI.pm
/Users/hsea/Sites/web-public/main/cgi/mt/lib/MT/ObjectDriver/DBI.pm
/Users/somatics/Sites/ccp51/cgi-bin/modules_dbi/DBI.pm
/Users/somatics/Sites/cgi/mt/lib/MT/ObjectDriver/DBI.pm
/Users/somatics/Sites/mt/lib/MT/ObjectDriver/DBI.pm

zCat

4:29 pm on Mar 19, 2005 (gmt 0)

10+ Year Member



It looks like you have a DBI.pm module, at least. Can you try the following:

perl -e 'use DBI;'

and report what it says?

Looking at it again I think the problem might be slightly different, i.e. DBI is not finding the requisite database driver module, which would be DBD::mysql.

Can you try also:

perl -e 'use DBD::mysql;'?

If there's no DBD::mysql module, you can do the following as root user:

perl -MCPAN -e 'install DBD::mysql'

and the module should be downloaded and installed for you. (It looks like someone has used the same process to install DBI.pm previously).

wholesteve

4:52 pm on Mar 19, 2005 (gmt 0)

10+ Year Member



Thanks again! I did all 3 things you said. I have included the results I got. Does this solve the problem? Do I need to also do install DBI in some way? (Please tell me how to do that if the answer is yes.)

[fred:~] root# perl -e 'use DBI;'
Can't locate loadable object for module DBI in @INC (@INC contains: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .) at DBI.pm line 255
BEGIN failed--compilation aborted at DBI.pm line 255.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

******************************************************************

[fred:~] root# perl -e 'use DBD::mysql;'
Can't locate DBD/mysql.pm in @INC (@INC contains: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

******************************************************************

[fred:~] root# perl -MCPAN -e 'install DBD::mysql'

Please, install Net::FTP as soon as possible. CPAN.pm installs it for you
if you just type
install Bundle::libnet

Issuing "/usr/bin/ftp -n"
Trying 209.221.142.118...
Connected to ftp.cpan.ddns.develooper.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 08:42. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
230 Anonymous user logged in
Remote system type is UNIX.
Using binary mode to transfer files.
Local directory now /private/var/root/.cpan/sources/authors
250 OK. Current directory is /
250 OK. Current directory is /pub
250-The Comprehensive Perl Archive Network (http://www.cpan.org/)
250-master site has been from the very beginning (1995) hosted at FUNET,
250-the Finnish University NETwork.
250-
250-
250 OK. Current directory is /pub/CPAN
250 OK. Current directory is /pub/CPAN/authors
200 TYPE is now 8-bit binary
local: 01mailrc.txt.gz remote: 01mailrc.txt.gz
229 Extended Passive mode OK (¦¦¦42433¦)
150-Accepted data connection
150 94.6 kbytes to download
100% ¦*******************************************************************¦ 96846 81.28 KB/s 00:00 ETA
226-File successfully transferred
226 0.001 seconds (measured here), 122.83 Mbytes per second
96846 bytes received in 00:01 (80.62 KB/s)
221-Goodbye. You uploaded 0 and downloaded 95 kbytes.
221 Logout.
GOT /private/var/root/.cpan/sources/authors/01mailrc.txt.gz
Going to read /private/var/root/.cpan/sources/authors/01mailrc.txt.gz
Could pipe[/sw/bin/gzip --decompress --stdout /private/var/root/.cpan/sources/authors/01mailrc.txt.gz ¦]: No such file or directory at /System/Library/Perl/CPAN.pm line 4379.

[fred:~] root#

******************************************************************

AFTER THAT, I PERFORMED THE FIRST COMMAND YOU SAID I SHOULD TRY, IN CASE THAT PROVIDED SOME USEFUL FEEDBACK ABOUT THE PROCESS THUS FAR; HERE IS WHAT I GOT:

[fred:~] root# perl -e 'use DBI;'
Can't locate loadable object for module DBI in @INC (@INC contains: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .) at DBI.pm line 255
BEGIN failed--compilation aborted at DBI.pm line 255.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
[fred:~] root#

wholesteve

4:13 am on Mar 22, 2005 (gmt 0)

10+ Year Member



I also tried
perl -e 'use DBD::mysql;'
again, to see how that behaves after running CPAN to install it as you suggested.

This was the result:

[fred:~] root# perl -e 'use DBD::mysql;'
Can't locate DBD/mysql.pm in @INC (@INC contains: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

So, what does this all mean? I'm still at a loss to understand what I must do now to fix this problem.

Anyone have any advice? I can't move forward with setting up my site if I don't fix this!

zCat

7:50 am on Mar 22, 2005 (gmt 0)

10+ Year Member



Sorry for the delay, I've been having a few local difficulties of my own ( **** hardware ) :-( .

Unfortunately I have to admit I'm guessing in the dark as far as Perl on OSX is concerned. I do have such a beast here but haven't had the time to get familiar with it.

I'd suggest you find a forum where Perl and Mac people coincide. I found the forums on the Apple site very helpful:

[discussions.info.apple.com...]

under:
Mac OS X and Related Software -> Mac OS X v10.3 Panther

There's a Unix forum there; the participants look pretty knowledgable.

Sorry not to be of any more help.