Truman has asked for the wisdom of the Perl Monks concerning the following question:

Hi Fellow Monks,

I am upgrading my previous Apache 1.3.27 to 2.0 (latest) for a perl application, both SSL enabled and on Win32. I have just setup Apache 2.0 with Mod_perl2. The problem is coming when I am trying to port application code. The following error is encountered during the execution of startup.pl:

" $parms->add_config() has failed: Global $r object is not available. Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf"

Some old posts on the web suggested this to be a cgi.pm problem and so I installed the latest version of CGI but the problem persists.

I also have Apache2::Compat so I guess backward compatibility should not be an issue.

I have updated and reinstalled the Apache2::Request module.

I also explicitly put the "PerlOptions +GlobalRequest" statement in the httpd.conf file but the error is still there.

I am stuck here..any suggestions? Thanks in advance.

  • Comment on mod_perl2/Apache2 problem: "Global $r object unavailable..."

Replies are listed 'Best First'.
Re: mod_perl2/Apache2 problem: "Global $r object unavailable..."
by Anonymous Monk on Sep 30, 2005 at 07:03 UTC
    Are you loading Apache2::compat? In startup.pl? Can you show actual config/code?
      Yes, I am loading Apache2::compat in startup.pl

      The config file (httpd.conf) is very big. Do you want any particular section of it? Let me know, I will post the section here.

Re: mod_perl2/Apache2 problem: "Global $r object unavailable..."
by perrin (Chancellor) on Sep 30, 2005 at 18:44 UTC
    Which package are you using to install this? I recommend using one of the ones from the mod_perl site, compiled by Randy Kobes.
Re: mod_perl2/Apache2 problem: "Global $r object unavailable..."
by kulls (Hermit) on Sep 10, 2009 at 07:42 UTC
    Hi,
    I'm also getting the same error. I have upgrade the  CGI version to 3.45, But still I'm getting this error.
    Any suggestion on this ?
    - Raja