Error - Can't locate object method "connect" via package "DBI"

Apologies if this has been asked and answered elsewhere.

Yesterday, I got most of hte way through an install or RT on a SuSE 7.3
box. After a nagging problem where Apache wasn’t able to find the DBI.pm
module was resolved (I copied it from one directory to another to fix it),
the server starts, but throws a 500 internal server error. The error in
the log reads:

[Thu Jan 10 10:15:23 2002] [error] Can’t locate object method
"connect" via package “DBI” (perhaps you forgot to load “DBI”?) at
/usr/lib/perl5/site_perl/5.6.1/DBIx/SearchBuilder/Handle.pm line 121.

TIA,

Sam Leibowitz (sleibowitz@btcwcu.org)
Project Manager
Business Technology Center (http://www.btcwcu.org)

Sam Leibowitz escribi�:

Apologies if this has been asked and answered elsewhere.

Yesterday, I got most of hte way through an install or RT on a SuSE 7.3
box. After a nagging problem where Apache wasn’t able to find the DBI.pm
module was resolved (I copied it from one directory to another to fix it),
the server starts, but throws a 500 internal server error. The error in
the log reads:

[Thu Jan 10 10:15:23 2002] [error] Can’t locate object method
"connect" via package “DBI” (perhaps you forgot to load “DBI”?) at
/usr/lib/perl5/site_perl/5.6.1/DBIx/SearchBuilder/Handle.pm line 121.

You have to install the package DBI after the Apache::DBI
The order is important here. I’ve been looking too for this, and as far
I got, is not documented. Maybe would be a good entry to the FAQ.

Greetings.
Adri�n Galindo
Mexico City

Adrian Galindo wrote:

Sam Leibowitz escribi�:

Apologies if this has been asked and answered elsewhere.

Yesterday, I got most of hte way through an install or RT on a SuSE 7.3
box. After a nagging problem where Apache wasn’t able to find the DBI.pm
module was resolved (I copied it from one directory to another to fix it),
the server starts, but throws a 500 internal server error. The error in
the log reads:

[Thu Jan 10 10:15:23 2002] [error] Can’t locate object method
"connect" via package “DBI” (perhaps you forgot to load “DBI”?) at
/usr/lib/perl5/site_perl/5.6.1/DBIx/SearchBuilder/Handle.pm line 121.

You have to install the package DBI after the Apache::DBI
The order is important here. I’ve been looking too for this, and as far
I got, is not documented. Maybe would be a good entry to the FAQ.

There’s no reason for installation order to effect Perl finding or not finding
modules. I installed all of the normal DBI and DBD::* packages before even
installing Apache::DBI and it works fine.

You may need to do more than just copy one DBI.pm file over and install the
whole DBI package. There’s a DBI.so and a bunch of other files that DBI
installs into perl. This is the list of files from the DBI-1.20.tar.gz
that get installed into Perl:

% find arch lib -type f
arch/auto/DBI/.exists
arch/auto/DBI/DBIXS.h
arch/auto/DBI/dbipport.h
arch/auto/DBI/dbd_xsh.h
arch/auto/DBI/dbi_sql.h
arch/auto/DBI/Driver.xst
arch/auto/DBI/DBI.so
arch/auto/DBI/DBI.bs
lib/.exists
lib/auto/DBI/.exists
lib/DBD/NullP.pm
lib/DBD/ExampleP.pm
lib/DBD/Proxy.pm
lib/DBD/Sponge.pm
lib/DBI/Format.pm
lib/DBI/Shell.pm
lib/DBI/FAQ.pm
lib/DBI/W32ODBC.pm
lib/DBI/DBD.pm
lib/DBI/ProxyServer.pm
lib/DBI.pm
lib/Bundle/DBI.pm
lib/Win32/DBIODBC.pm

Best,
Blair

Greetings.
Adri�n Galindo
Mexico City


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Blair Zajac blair@orcaware.com
Web and OS performance plots - http://www.orcaware.com/orca/

Sam Leibowitz escribi�:

Yesterday, I got most of hte way through an install or RT on a SuSE 7.3
box. After a nagging problem where Apache wasn’t able to find the DBI.pm
module was resolved (I copied it from one directory to another to fix it),
the server starts, but throws a 500 internal server error. The error in
the log reads:

That’s because you haven’t installed the module properly. DBI, and
many other Perl modules, use various support files as well as the
basic DBI.pm file.

Try installing DBI properly, using CPAN.pm or the "perl Makefile.PL"
method.

If your Perl still can’t find the DBI module, use “use lib” or the
PERL5LIB environment variable.

You have to install the package DBI after the Apache::DBI
The order is important here. I’ve been looking too for this, and as far
I got, is not documented. Maybe would be a good entry to the FAQ.

This is wrong. In terms of installation, you should deal with DBI
before Apache::DBI.

However, if you’re talking about using the modules in your Apache
configuration, then use/requiring DBI before Apache::DBI will cause
problems. However, once you’ve done a “use Apache::DBI”, there’s no
need to do a “use DBI” because Apache::DBI does this for you and takes
over DBI’s namespace.

For more details see
http://perl.apache.org/guide/databases.html#Apache_DBI_Initiate_a_persist

Tom