perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Hilbig <thil...@yahoo.com>
Subject Re: Reinstall gets Can't locate Apache.pm
Date Fri, 05 May 2006 20:15:05 GMT


--- Tyler MacDonald <tylerm@ca.sophos.com> wrote:

> Thomas Hilbig <thilbig@yahoo.com> wrote:
> > I was getting the error even from running perl
> > interactively
> > linux>perl
> > use CGI ;
> > Can't locate Apache.pm in @INC
> > 
> > I think the problem may be that I am simply
> missing
> > the MOD_PERL_API_VERSION environment variable in
> my
> > shell environment.  I had MOD_PERL set in my shell
> > environment (from when??), but not the other.
> > 
> > Hopefully, I haven't butchered my Perl install
> beyond
> > repair.
> 
> 	Weird! Are you running the latest version of CGI?
> If not, that could
> be the problem, CGI had to be updated to support
> mod_perl2.
> 
> 	Cheers,
> 		Tyler
> 
Originally I was using CGI 3.16, but the 3.20 has the
same check:

if (exists $ENV{MOD_PERL}) {
  # mod_perl handlers may run system() on scripts
using CGI.pm;
  # Make sure so we don't get fooled by inherited
$ENV{MOD_PERL}
  if (exists $ENV{MOD_PERL_API_VERSION} &&
$ENV{MOD_PERL_API_VERSION} == 2) {
    $MOD_PERL = 2;
    require Apache2::Response;
    require Apache2::RequestRec;
    require Apache2::RequestUtil;
    require Apache2::RequestIO;
    require APR::Pool;
  } else {
    $MOD_PERL = 1;
    require Apache;
  }
}

Having the MOD_PERL environment but not having
MOD_PERL_API_VERSION causes grief.  However, the
instructions do say it is required so it's my fault
for not catching it earlier.

Tom

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message