apache_dbi_modperl_difficulty

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



dbi-users@isc.org

Subject: Re: MySQL/Apache/mod_perl/DBI Woes
From: Paul Lukins <plukins@flashcom.net>
Date: Wed, 20 Sep 2000 21:40:25 -0700

axtjr@uaa.alaska.edu wrote:
> 
> I've got a problem (of course) and am hoping someone has had experience with
> it. Listed below are the relevant peices of information, if you need anymore
> please feel free to ask. Can someone tell me why I'm getting the error that
> I am? And, how to fix it?
> 
> My setup is this:
> Running on FreeBSD 3.2
> Server version: Apache/1.3.12 (Unix) with mod_perl 1.24
> MySQL 3.22.32
> perl 5.005 w/ the following module combinations:
> Bundle::DBD::mSQL (J/JW/JWIED/Msql-Mysql-modules-1.2215.tar.gz)
> Bundle::DBD::mysql (J/JW/JWIED/Msql-Mysql-modules-1.2215.tar.gz)
> Bundle::DBI     (T/TI/TIMB/DBI-1.14.tar.gz)
> 
> AND
> Bundle::DBD::mSQL (J/JW/JWIED/Msql-Mysql-modules-1.2214.tar.gz)
> Bundle::DBD::mysql (J/JW/JWIED/Msql-Mysql-modules-1.2214.tar.gz)
> Bundle::DBI     (T/TI/TIMB/DBI-1.13.tar.gz)
> 
> I'm using the following script. If I run it from the command line I get the
> appropriate feedback and the script runs properly. When attempting to run it
> from a web interface I get an Internal Error w/ the following log entries.
> 
> Test Script:
> #!/bin/perl -w
> 
> use DBI;
> use CGI;
> 
> my $q = new CGI;
> 
> print($q->header());
> print($q->start_html());
> 
> my $dbh = DBI->connect('dbi:mysql:kosh_db', 'validuserid', 'validpwd') ||
> die("$DBI::errstr");
> 
> my @tables = $dbh->tables();
> 
> print("Displaying current tables...\n");
> 
> foreach my $table ( @tables ) {
>         print($q->p("Table: $table"));
> #       print("Table: $table\n");
> }
> 
> $dbh->disconnect();
> 
> print($q->end_html());
> 
> Log Entries:
> 
> [Tue Sep 19 15:23:46 2000] null: Use of uninitialized value at
> /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/DBI.pm line 687.
> [Tue Sep 19 15:23:46 2000] [error] [Tue Sep 19 15:23:46 2000] null:
> Undefined subroutine &DBD::mysql::db::_login called at
> /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/DBD/mysql.pm line 82.
>         (in cleanup) [Tue Sep 19 15:23:46 2000] null: Driver has not
> implemented DESTROY for DBI::db=HASH(0x843561c) at
> /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/Apache/Registry.pm line
> 144

I use pretty much the same setup and have seen problems like this.  Most of the
time it's because I modified a file that apache already has in cache, and the
cache doesn't get updated automatically.  This is true of any 'use'd or
'require'd scripts/modules.  Try restarting the server.

Here's a link with some good info on the topic:

http://perl.apache.org/dist/mod_perl_traps.html

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu