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

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;

Replies are listed 'Best First'.
Re^3: Should I upgrade from mod_perl 1.0 to 2.0? and if so, how?
by Corion (Patriarch) on Feb 17, 2009 at 14:52 UTC

    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?

        Again, looking at the Apache::DBI source code, it seems that Apache.pm should be there once you're running under mod_perl (1), so, the circumstances point to you not running under mod_perl.