cancel
Showing results for 
Search instead for 
Did you mean: 

Perl script fails to work after move (DBI related?)

N/A

Perl script fails to work after move (DBI related?)

I have some nice perl scripts for a content management system which use DBI::mysql. Since the upgrade I suddenly have a problem when I try to run the scripts - they all crash out with (my php scripts all work fine, but they don't use these modules, since they're php) :

An error occurred: Unsupported driver MT::ObjectDriver::DBI::mysql: Can't locate DBI.pm in @INC (@INC contains: /files/home/eaglecentre/cgi-bin/extlib
/files/home/eaglecentre/cgi-bin/lib /usr/local/lib/perl5/site_perl/5.8.2/mach
/usr/local/lib/perl5/site_perl/5.8.2 /usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.2/BSDPAN /usr/local/lib/perl5/5.8.2/mach
/usr/local/lib/perl5/5.8.2 .)
at /files/home/eaglecentre/cgi-bin/lib/MT/ObjectDriver/DBI.pm line 9.
BEGIN failed--compilation aborted at
/files/home/eaglecentre/cgi-bin/lib/MT/ObjectDriver/DBI.pm line 9.
Compilation failed in require at
/files/home/eaglecentre/cgi-bin/lib/MT/ObjectDriver/DBI/mysql.pm line 9. BEGIN failed--compilation aborted at
/files/home/eaglecentre/cgi-bin/lib/MT/ObjectDriver/DBI/mysql.pm line 9. Compilation failed in require at (eval 3) line 1. BEGIN failed--compilation aborted at (eval 3) line 1.



I'm also using MovableType (http://www.movabletype.org) to do content management, and since they're using the same libraries, I'm getting nowhere.

In addition, I wrote a test script:
 {file: [url]http://cgi.eaglecentre.force9.co.uk/cgi-bin/testDBI.pl[/url] }

#!/usr/bin/perl -w
use DBI;
#definition of variables
$db="MYTEST";
$host="localhost";
$user="root";
$password="rootpass"; # the root password

#connect to MySQL database
my $dbh = DBI->connect ("DBI:mysql:database=$db:host=$host",
$user,
$password)
or die "Can't connect to database: $DBI::errstr\n";

#disconnect from database
$dbh->disconnect or warn "Disconnection error: $DBI::errstr\n";

exit;

I plonked it in the cgi directory, and then tried to run it through the command line and got this error:

Can't locate DBI.pm in @INC (@INC contains:
/usr/local/lib/perl5/site_perl/5.8.2/mach
/usr/local/lib/perl5/site_perl/5.8.2
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl/5.005
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.2/BSDPAN
/usr/local/lib/perl5/5.8.2/mach
/usr/local/lib/perl5/5.8.2 .) at testDBI.pl line 2.
BEGIN failed--compilation aborted at testDBI.pl line 2.


To me, this all seems to point to a configuration problem with DBI? What do other people think? Anyone have this working, at all?
This is supported by movable-type's config wizard:
http://cgi.eaglecentre.force9.co.uk/cgi-bin/mt-check.cgi
which says:
....

CHECKING FOR DATA STORAGE MODULES:

The following modules are used by the different data storage options in
Movable Type. In order run the system, your server needs to have at least
one of these modules installed.

DB_File...
Your server has DB_File installed (version 1.807).

DBD::mysql...
Your server does not have DBD::mysql installed. DBI and
DBD::mysql are required if you want to use the MySQL database
backend. Please consult the installation instructions for help
in installing DBD::mysql.

DBD::Pg...
Your server does not have DBD::Pg installed. DBI and DBD::Pg
are required if you want to use the PostgreSQL database
backend. Please consult the installation instructions for help
in installing DBD::Pg.

DBD::SQLite...
Your server does not have DBD::SQLite installed. DBI and
DBD::SQLite are required if you want to use the SQLite database
backend. Please consult the installation instructions for help
in installing DBD::SQLite.

:?
Any help greatly appreciated!!


[edit: fixed all those links!]
12 REPLIES
N/A

Perl script fails to work after move (DBI related?)

I've raised this over on the Feedback Thread on PlusNet - I'll keep you updated on what happens.

I don't know if you want to raise a link:Contact Us ticket about it or not, it might be spotted sooner though Smiley
N/A

Perl script fails to work after move (DBI related?)

I've actually already raised this with them, but the ticket was returned:
Quote
'We do not directly support scripting, you will need to raise this in our user forums in the Member Centre.'

So, here I am Cheesy
N/A

Perl script fails to work after move (DBI related?)

Oh, oh well.
N/A

Perl script fails to work after move (DBI related?)

I also get the 'Cannot locate DBI.pm' error when I try to use perl to access my mySQL tables, and I too received the message that "we do not directly support scripting..."

I was told that there must be a problem with my scripts (although they worked just fine on Thursday) and that other users had had the same problems, but had found the answers here on the forum and fixed their scripts. However I only see other people with failing scripts, no solutions! Sad

Does anyone out there know what has changed?
N/A

Perl script fails to work after move (DBI related?)

Perl was upgraded late last night / early this morning from 5.61 to 5.82 so I think that may have caused something....
N/A

Perl script fails to work after move (DBI related?)

I've seen this same bug occur when perl gets partially upgraded -> i.e. not all the of perl is upgraded. I'd guess that the versions are out of sync or something similar for dbi?
N/A

Perl script fails to work after move (DBI related?)

But the question is what can be done about it? I'm pretty sure we don't have write access to that appropriate directories (and quite right too - I wouldn't want me poking around in there!) but tech support clearly think it is no longer their problem. When I rang them they were quite specific...
Plusnet Staff
Plusnet Staff
Posts: 12,169
Thanks: 18
Fixes: 1
Registered: 04-04-2007

Perl script fails to work after move (DBI related?)

Hi,

If the problem is down to an error with the upgrade then we should be able to fix it. If you send a ticket in with the error message generate and the exact page (or directions on replicating the error) we can pass it through to our netwok team to take a look.
N/A

Perl script fails to work after move (DBI related?)

I have already tried that - they told me to try the forums since the problem had already been solved here but I suppose I can try again - I'm getting really depressed by all this.

Just in case, here is the script I'm trying. It really can't be much simpler and I have checked to make sure table 'test' has some data in it.: (oh and I've substituted XXXXXX for my db password - you understand!)
---------------------------------------------------------------------
#!/usr/bin/perl -w

use DBI;

my $dbh = DBI->connect('DBI:mysql:merlinsystems_f9:rumpus', 'merlinsystems','XXXXX') or die $DBI::errstr;

my $SQL = "select * from test";

my $cursor = $dbh->prepare($SQL);

$cursor->execute;

while ($ref = $cursor->fetch) {
print "found " . join ('=',@{$ref}) . " only\n";
}
---------------------------------------------------------------------
And the error when I run this from a command prompt is :

Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.2/mach /usr/local/lib/perl5/site_perl/5.8.2 /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.2/BSDPAN /usr/local/lib/perl5/5.8.2/mach /usr/local/lib/perl5/5.8.2 .) at ./dbi_test.pl line 3.
BEGIN failed--compilation aborted at ./dbi_test.pl line 3.

I'l try logging this as well, and if I get any response, I'll update you all.
N/A

Perl script fails to work after move (DBI related?)

I've added this detail to my existing open call #11299851
N/A

Perl script fails to work after move (DBI related?)

This is now fixed for me, and for all my scripts Cheesy

Schweet

Cool
N/A

Perl script fails to work after move (DBI related?)

Likewise! And I had a reply from tech support confirming that they'd re-installed the libraries.

I can catch up on my lost sleep now... Wink