[rt-devel] RT3/Apache2/Mod_Perl2 (Global $r object is not available.)

Brook Schofield brooksch at mac.com
Tue May 13 07:27:00 EDT 2003


I saw a posting by alex at porous.de in March this year - regarding the 
error message:


# /usr/local/apache2/bin/apachectl start
[Tue May 13 21:18:29 2003] [error] Global $r object is not available. 
Set:
         PerlOptions +GlobalRequest
in httpd.conf at 
/usr/local/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 
567.
Compilation failed in require at (eval 4) line 1.

[Tue May 13 21:18:29 2003] [error] Can't load Perl file: 
/opt/rt3/bin/webmux.pl for server XXXXXX.XXXXX.edu.au:0, exiting...


this is a change in behaviour between Mod_Perl 1.99_08 and 1.99_09 
(I've been using 1.99_07). I don't know whether this has gone away in 
later versions of HTML::Mason (I'm still using 1.17 rather than 1.20) 
but I needed to add the following to /opt/rt3/bin/webmux.pl to get 
everything working. I don't know what changes need to be made so this 
can be more universally applied to Mod_Perl 1 and Mod_Perl 2 instances.

# diff -c bin/webmux.pl /opt/rt3/bin/webmux.pl | more
*** bin/webmux.pl       Tue May 13 21:09:36 2003
--- /opt/rt3/bin/webmux.pl      Tue May 13 21:19:23 2003
***************
*** 33,38 ****
--- 33,48 ----
       $ENV{'IFS'}    = '' if defined $ENV{'IFS'};
   }

+ require Apache::RequestUtil;
+ no warnings 'redefine';
+ my $sub = *Apache::request{CODE};
+ *Apache::request = sub {
+     my $r;
+     eval { $r = $sub->('Apache'); };
+     # warn $@ if $@;
+     return $r;
+ };
+
   use lib ("/opt/rt3/local/lib", "/opt/rt3/lib");
   use RT;

I found the information @ 
http://www.mail-archive.com/modperl@apache.org/msg33301.html

-Brook




More information about the Rt-devel mailing list