Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Can’t locate DBI.pm in @INC Perl Script Error  (Read 8057 times)

0 Members and 1 Guest are viewing this topic.

lijeshk

  • Guest
Can’t locate DBI.pm in @INC Perl Script Error
« on: December 20, 2013, 10:49:55 pm »

The following error is due to Perl module DBI is missing, to install it:

Code: [Select]
Can’t locate DBI.pm in @INC
(@INC contains: /usr/local/flashcp/
/usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach
/usr/local/lib/perl5/5.8.8 .)
at /home/free/cgi-bin/index.cgi line 8.
BEGIN failed–compilation aborted

You need to log in to server and run cpan, cpanel allow you to install Perl modules:


Code: [Select]
server# cpan
cpan> install DBI
Running install for module DBI
Running make for T/TI/TIMB/DBI-1.50.tar.gz
LWP not available
Fetching with Net::FTP:
DBI-1.50.tar.gz
CPAN: Digest::MD5 loaded ok
LWP not available
Fetching with Net::FTP:

FreeBSD: Registering installation in the package database
Appending installation info to /usr/local/lib/perl5/5.8.8/mach/perllocal.pod
/usr/bin/make install — OK

cpan> exit
Terminal does not support GetHistory.
Lockfile removed.
server#

After installation type “exit” to exit cpan shell. AFter installing DBI,  the error is gone, now you will start getting an another error:

Code: [Select]
install_driver(mysql) failed:
Can’t locate DBD/mysql.pm in @INC
(@INC contains: /usr/local/flashcp/
/usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach
/usr/local/lib/perl5/5.8.8 .) at (eval 8) line 3.
Perhaps the DBD::mysql perl module hasn’t been fully installed,
or perhaps the capitalisation of ‘mysql’ isn’t right.
Available drivers: DBM, ExampleP, File, Proxy, Sponge.
at /home/free/cgi-bin/index.cgi line 16

To fix the problem, you need to install DBD::mysql module, so back to cpan:

install DBD::mysql did not worked, this is because it try to connect MySQL database for testing, but MySQL login with out password is disabled in the server. So we have to do force install:

Code: [Select]
server# cpan
Terminal does not support AddHistory.

cpan shell — CPAN exploration and modules installation (v1.7602)
ReadLine support available (try ‘install Bundle::CPAN’)

cpan> force install DBD::mysql

/usr/bin/make install — OK

cpan> exit
Terminal does not support GetHistory.
Lockfile removed.
server#

After installing DBD::mysql the perl script start working.

--