perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Prime <>
Subject Re: Getting DBI working during the server life cycle
Date Sun, 24 Jan 2010 04:34:47 GMT
Boysenberry Payne wrote:
> Hello,
> I'm trying to connect to my postgresql database using the DBI -> Apache::CBI ->
DBD::Pg combination of modules.
> I'm having trouble understanding Apache::DBI usage as it pertains to https pre request
server life cycle, in particular during the OpenLogs stage.
> My trouble comes from an error I'm getting from DBI:
> Global $r object is not available. Set:
> 	PerlOptions +GlobalRequest
> in httpd.conf at /usr/local/lib/perl5/site_perl/5.10.1/Apache/ line 144.
> So, obviously, the Apache::RequestRec object hasn't been globalized because it's before
the request stage (the child processes haven't even been forked yet.)
> If I use DBI in my file first, no problems, but Apache::DBI says to have it
load before DBI to use the persistent connections it offers, thus my dilemma.
> So, what do I do?

Don't use Apache::DBI 1.07 and try to do this, because as you've 
discovered, it's broken.



View raw message