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

I have an Apache 1.3.31 server running mod_perl 1.29 on SuSE Linux 9.1. I have a number of modules required however I came across a problem loading Apache::DBI. Here is the error message:
[Thu Jul 15 11:19:39 2004] [error] Can't locate Apache/DBI.pm in @INC +(@INC contains: /usr/local/apache/perl-lib/perl/lib /usr/local/apache +/perl-lib/perl /usr/lib/perl5/5.8.3/i586-linux-thread-multi /usr/lib/ +perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi /u +sr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/ +vendor_perl/5.8.3/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/ +5.8.3 /usr/lib/perl5/vendor_perl . /usr/local/apache/ /usr/local/apac +he/lib/perl) at /usr/local/apache/perl-lib/startup.pl line 27.\nBEGIN + failed--compilation aborted at /usr/local/apache/perl-lib/startup.pl + line 27.\nCompilation failed in require at (eval 2) line 1.\n Syntax error on line 927 of /usr/local/apache/conf/httpd.conf: Can't locate Apache/DBI.pm in @INC (@INC contains: /usr/local/apache/p +erl-lib/perl/lib /usr/local/apache/perl-lib/perl /usr/lib/perl5/5.8.3 +/i586-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_per +l/5.8.3/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/l +ib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3/i586-linux-thread +-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl . +/usr/local/apache/ /usr/local/apache/lib/perl) at /usr/local/apache/p +erl-lib/startup.pl line 27. BEGIN failed--compilation aborted at /usr/local/apache/perl-lib/startu +p.pl line 27. Compilation failed in require at (eval 2) line 1. ../bin/apachectl start: httpd could not be started


This error comes up when I start up Apache. Naturally I figure Apache::DBI is not loaded so I attempt to install via CPAN:

perl -MCPAN -e 'install Apache::DBI' CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Thu, 15 Jul 2004 10:05:01 GMT Running install for module Apache::DBI Running make for A/AB/ABH/Apache-DBI-0.94.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /root/.cpan/sources/authors/id/A/AB/ABH/Apache-DBI-0.94.t +ar.gz ok Scanning cache /root/.cpan/build for sizes Apache-DBI-0.94/ Apache-DBI-0.94/t/ Apache-DBI-0.94/t/10mysql.t Apache-DBI-0.94/eg/ Apache-DBI-0.94/eg/startup.pl Apache-DBI-0.94/README Apache-DBI-0.94/MANIFEST Apache-DBI-0.94/AuthDBI.pm Apache-DBI-0.94/Changes Apache-DBI-0.94/Makefile.PL Apache-DBI-0.94/DBI.pm Apache-DBI-0.94/traces.txt Removing previously used /root/.cpan/build/Apache-DBI-0.94 CPAN.pm: Going to build A/AB/ABH/Apache-DBI-0.94.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Apache::DBI cp AuthDBI.pm blib/lib/Apache/AuthDBI.pm cp DBI.pm blib/lib/Apache/DBI.pm Manifying blib/man3/Apache::DBI.3pm Manifying blib/man3/Apache::AuthDBI.3pm /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/10mysql....ok 4/10# Failed test (t/10mysql.t at line 35) t/10mysql....NOK 5# The object isn't defined t/10mysql....ok 9/10# Looks like you failed 1 tests of 10. t/10mysql....dubious Test returned status 1 (wstat 256, 0x100) Scalar found where operator expected at (eval 153) line 1, near "'int' + $__val" (Missing operator before $__val?) DIED. FAILED test 5 Failed 1/10 tests, 90.00% okay (less 5 skipped tests: 4 okay, +40.00%) Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/10mysql.t 1 256 10 1 10.00% 5 5 subtests skipped. Failed 1/1 test scripts, 0.00% okay. 1/10 subtests failed, 90.00% okay +. make: *** [test_dynamic] Error 1 /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force
Any thoughts on where I went wrong? I noticed it failed a test with the name "mysql.t". Cpan didn't show any database dependancies for Apache::DBI. It has a prerequisite however I didn't think it would cause the above failure.

PERL_CHILD_INIT=1 PERL_STACKED_HANDLERS=1.

Thanks!!!

Replies are listed 'Best First'.
Re: Trouble installing Apache::DBI
by dragonchild (Archbishop) on Jul 15, 2004 at 17:21 UTC
    Have you tried installing it by hand and reading the INSTALL or README files? Maybe there's some command-line options you need to set. Remember, the CPAN module uses the defaults, which aren't always usable on a given system. This is especially true for database-type modules. Those, I always install by hand.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

      Yahoo!

      Ok. I've manually installed software from tarball before. Never a perl module. Looks like it installed just fine from scratch. I simply became too dependant on CPAN installing it for me :-)

      Apache now starts up without complaint.

      Thanks for the tip!!
Re: Trouble installing Apache::DBI
by perrin (Chancellor) on Jul 15, 2004 at 17:27 UTC
    Apache::DBI comes with mod_perl. Chances are, you either have been mucking with your perl installation since installing mod_perl, or have done something that changes the permissions on Apache/DBI.pm so mod_perl can't find it. Try locating the file and then check the permissions and your @INC to debug why it isn't being found.
      I didn't see it with the mod_perl tarball. I'm using mod_perl 1.29 btw. This server is a fresh install. Permissions haven't been modified.

      FYI... I did a locate and noticed DBI.pm in several locations. None of them were in my @INC path. Interesting. At this time it's working and I'll be messing with some Perl on Apache.

      Hopefully smooth sailing at this point :D
        You're right, it seems to have been removed at some point. So, the advice to install without CPAN was the right one. It just doesn't have tests that play well with the CPAN module.
Re: Trouble installing Apache::DBI
by knoebi (Friar) on Jul 16, 2004 at 07:07 UTC
    you installed it by hand? i'am wondering if the make test worked for you? if a test fails and i think this is no problem, i usually just use (with cpanp) skiptest 1 and so the tests are not performed and often the module installs fine.

    ciao, knoebi

      Yes. Basically I ran

      perl Makefile.PL
      make
      make install

      Looks like it installed just fine.

      I didn't know skipping tests was an option. Makes sense :-)