msouth has asked for the wisdom of the Perl Monks concerning the following question:
if i run this from the command line, it prints what I expect:#!perl -w use strict; use DBI; my $dbh = DBI->connect('dbi:mysql:database=msouth_reg_db;host=redacted +.example.com', 'user', 'pass'); my $rc = $dbh->disconnect; warn "dbh->disconnect returned [$rc]\n"; if (my $ping_val = $dbh->ping) { warn 'here is the thread id ['. $dbh->{mysql_thread_id} ."]\n"; warn "ping returned [$ping_val]\n"; warn "here are Apache-matching keys \%INC:". join "\n", grep {/Apa +che/} keys %INC; } else { warn "ping returned [$ping_val]"; }
If it runs via a "PerlRequire" in my apache conf:dbh->disconnect returned [1] ping returned [] at /home/msouth/disconnect.pl line 14.
the output upon starting apache is as follows:ErrorLog /home/msouth/local/apache/logs/error.log LockFile /home/msouth/local/apache/logs/httpd.lock PidFile /home/msouth/local/apache/logs/httpd.pid # Mod-perl <IfModule mod_perl.c> PerlRequire /home/msouth/disconnect.pl </IfModule> Port 8106
(new edit with additional information)dbh->disconnect returned [1] here is the thread id [774516] ping returned [1] here are Apache-matching keys %INC: at /home/msouth/disconnect.pl line + 11.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: disconnect, then ping returns true under apache, false from command line, no Apache::DBI around. Why would this be?
by wazoox (Prior) on Mar 30, 2006 at 10:40 UTC | |
by msouth (Sexton) on Mar 30, 2006 at 15:40 UTC | |
by msouth (Sexton) on Mar 30, 2006 at 18:07 UTC | |
by perrin (Chancellor) on Mar 30, 2006 at 17:15 UTC | |
by derby (Abbot) on Mar 30, 2006 at 15:15 UTC |