in reply to Apache::DBI "cannot find apache.pm" failure - Should I upgrade from mod_perl 1.0 to 2.0? and if so, how?

You can help us help you better by showing us startup.pl, especially the line 28, which fails. I don't think upgrading mod_perl to 2.0 is a solution for everything, since mod_perl 2 is different from mod_perl 1 in many situations.

Replies are listed 'Best First'.
Re^2: Should I upgrade from mod_perl 1.0 to 2.0? and if so, how?
by MashMashy (Sexton) on Feb 17, 2009 at 14:47 UTC
    Whoops, sorry, meant to put that in:
    #!/usr/local/bin/perl -w $ENV{MOD_PERL} or die "GATEWAY_INTERFACE not Perl!"; use Apache::DBI; use strict; Apache::DBI->connect_on_init('DBI:mysql:database=dbname;host=localhost +','dbuser','',{ PrintError => 1, RaiseError => 0, AutoCommit => 1}); +### THIS IS LINE 28 WITH NAMES / PWDS TAKEN OUT Apache::DBI->setPingTimeOut('DBI:mysql:dbname', 0); 1;

      From looking at the Apache::DBI source code, the error message Apache.pm was not loaded is raised if it doesn't detect a true value in $INC{'Apache.pm'}. This indicates to me that you're not running your script under mod_perl at all, or (really remote) that Apache.pm fails to load. Maybe put use Apache; into your main script, just for a test.

        done, and done - if by "main script" you mean "startup.pl", I did so, and got:

        "Can't locate Apache.pm in @INC" etc etc etc.

        Am I missing an install?