Subject: | Apache::DBI 1.07 makes it impossible to fetch data through DBI from startup.pl |
using this as my startup.pl
use lib qw(/www/perl);
use ModPerl::Util (); #for CORE::GLOBAL::exit
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::RequestUtil ();
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
use Apache2::Connection ();
use Apache2::Const ();
use Apache2::Log ();
use APR::Table ();
use Apache::DBI;
use DBI;
my $dsn = "dbi:mysql::localhost:3306";
my $user = 'perl';
my $pw = 'xxxxx';
my $dbh = DBI->connect($dsn, $user, $pw);
1;
configured like
PerlPostConfigRequire /www/conf/startup.pl
i get the following in the error_log
[Sun Jun 01 23:27:36 2008] [error] Global $r object is not available.
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
/usr/lib64/perl5/site_perl/5.8.8/Apache/DBI.pm line 144.\nCompilation
failed in require at (eval 2) line 1.\n
[Sun Jun 01 23:27:36 2008] [error] Can't load Perl file:
/www/conf/startup.pl for server pooptop:0, exiting...
$r is not available because there is no request occuring. Adding
PerlOptions +GlobalRequest has no effect (which is not surprising, since
there is no request occuring while startup.pl is running).
i'm running:
perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.23-gentoo-r6, archname=x86_64-linux
uname='linux pooptop 2.6.23-gentoo-r6 #1 sat jan 26 22:06:10 est
2008 x86_64 amd turion(tm) 64 mobile technology mk-36 authenticamd
gnulinux '
config_args='-des -Darchname=x86_64-linux -Dcccdlflags=-fPIC
-Dccdlflags=-rdynamic -Dcc=x86_64-pc-linux-gnu-gcc -Dprefix=/usr
-Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth=
-Doptimize=-march=athlon64 -O2 -pipe -Duselargefiles -Dd_semctl_semun
-Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1
-Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm
-Dinc_version_list=5.8.0 5.8.0/x86_64-linux 5.8.2 5.8.2/x86_64-linux
5.8.4 5.8.4/x86_64-linux 5.8.5 5.8.5/x86_64-linux 5.8.6
5.8.6/x86_64-linux 5.8.7 5.8.7/x86_64-linux -Dcf_by=Gentoo -Ud_csh
-Dusenm -Di_ndbm -Di_gdbm -Di_db
-Dusrinc=/usr/include/gentoo-multilib/amd64 -Dlibpth=/usr/local/lib64
/lib64 /usr/lib64'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe
-Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm',
optimize='-march=athlon64 -O2 -pipe',
cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement
-I/usr/include/gdbm'
ccversion='', gccversion='4.1.2 (Gentoo 4.1.2 p1.0.1)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='x86_64-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib64'
libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.6.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64'
Characteristics of this binary (from libperl):
Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT
USE_LARGE_FILES USE_PERLIO
Built under linux
Compiled at May 19 2008 22:08:38
@INC:
/etc/perl
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux
/usr/lib64/perl5/vendor_perl/5.8.8
/usr/lib64/perl5/vendor_perl
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux
/usr/lib64/perl5/site_perl/5.8.8
/usr/lib64/perl5/site_perl
/usr/lib64/perl5/5.8.8/x86_64-linux
/usr/lib64/perl5/5.8.8
/usr/local/lib/site_perl
.
libapreq 2.08
mod_perl 2.0.4
httpd 2.2.8