opensubscriber
   Find in this group all groups
 
Unknown more information…

m : modperl@perl.apache.org 12 September 2009 • 10:23PM -0400

Re: FW: Apache::DBI Failed due to +GlobalRequest
by Brad Van Sickle

REPLY TO AUTHOR
 
REPLY TO GROUP




I've run into this before.   It's a bug in v1.07 of Apache::DBI

Open up the Apache/DBI.pm source file (on one of my test systems it's
installed in /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm) aind the
following block of code:
/   if (!$Rollback{$Idx}) {
        my $r;
        if (MP2) {
                $r = Apache2::RequestUtil->request;
                }
        elsif (Apache->can('push_handlers')) {
            $r = 'Apache';
        }
/
The problem with this is that if you're calling this from startup.pl
you're not actually in a request at that point  (as someone already
mentioned) so without the eval there the script dies.

Fix it by wrapping the "/$r = Apache2::RequestUtil->request;/" part in
an eval so it looks like this: /eval { $r = Apache2::RequestUtil->request;}

/






André Warnier wrote:
> Kulasekaran, Raja wrote:
>> Hi,
>>
>> Thanks for your mail. I did tried. It's not working .
>>
> Yes, I am sorry.  I did not look close enough at the following error :
>
> [Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
> Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
> /var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
> require at (eval 5) line 1.\n
>
> In a mod_perl *request* handler, the first argument
> (my $r = shift;)
> is usually a pointer to the current Request object.
>
> But in your startup script (startup.pl), that is not the case, because
> when that script is run, there is no request yet.
> I don't know what you are trying to do with $r in that startup script,
> but something is wrong and maybe the error message above is misleading.
> (I mean that it may have nothing to do with GlobalRequest at that stage.)

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.