Posted on 2006-04-05 21:15:57-07 by robertb
Error message from Apache:DBI : Not a subroutine reference at line 209
Can you help me? Each time I execute my small cgi program under mod_perl I get the message:
[Wed Apr 05 17:45:47 2006] [error] [client 81.111.11.111] Not a subroutine reference at /usr/lib/pe +rl5/site_perl/5.8.5/Apache/DBI.pm line 209.\n
in the Apache error log.
The message appears to be issued after I 'close' the mysql connection using conventional DBI. That is after my script has finished.
I have had a look at line 209 of /usr/lib/perl5/site_perl/5.8.5/Apache/DBI.pm which seems to have no subroutine reference...
: my $dbh = $Connected{$Idx}; :
The Apache::DBI version is '0.9901'

httpd -V gives:
Server version: Apache/2.0.52 Server built: Aug 31 2005 10:47:52 Server's Module Magic Number: 20020903:9 Architecture: 32-bit Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"
The OS is Red Hat Enterprise Linux ES release 4 (Nahant Update 2)

My Apache config entry is:
LoadModule perl_module modules/mod_perl.so PerlWarn On PerlTaintCheck On PerlRequire /usr/local/hbcstats/wwwroot/bin/startup.pl Alias /hbcperl /usr/local/hbcstats/wwwroot/mod_perl-bin <Directory /usr/local/hbcstats/wwwroot/mod_perl-bin> SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Directory>
My startup.pl is :
use strict ; use CGI(); CGI->compile('all'); use Apache2; use Apache::compat; use IO::Handle(); use File::Basename(); use Apache::DBI (); DBI->install_driver("mysql") ; my $DBconnectstring = "DBI:mysql:" ; my $dbname = "auctionlive" ; my $my_live_cnf = "/data/hbcweb/mysql/etc/my.cnf" ; # ------------------ my $my_cnf = "mysql_read_default_file=$my_live_cnf" ; my $my_group = "mysql_read_default_group=perl" ; $DBconnectstring .= "$dbname;$my_group;$my_cnf" ; my %attr = ( AutoCommit => 1, PrintError => 0, RaiseError => 0 ); Apache::DBI->connect_on_init("$DBconnectstring", "", "", \%attr ) or die "Cannot connect to live database from startup.pl: $DBI::errstr"; use Carp(); $SIG{__WARN__} = \%Carp::cluck; # Add application dirs to @INC use lib qw(/home/hbcweb/cgi-bin/zyview_conf/zvutils); require "zbase_utils_mysql.pl" ;
Many thanks to anyone who can help as I am unusualy devoid of ideas of where to go next with this one.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.