You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/09/26 18:14:26 UTC

Re: Can't locate object method "module" via package "Apache"

[CC'ing mod_perl list]

Jason Shaw wrote:

> Hi, I found the archive below, and am having the same problem.  Mine
> occurs whenever I try to start Apache.  I just want to know where I
> would put that "fix" that you posted below? Should I edit the DBI.pm
> file, or somewhere in my configuration script for apache?
> 
> thanks for your time and any help that can be given,
> -jason shaw.
> http://hcst.com
> 
> ----------------------------------------------------------------
> On Thu, 21 Jun 2001, Surat Singh Bhati wrote:
> 
> 
>>I am getting the following error in my strartup.pl
>>
>>perl -cx startup.pl
>>Can't locate object method "module" via package "Apache" at
>>/usr/local/lib/perl5
>>/site_perl/5.6.0/Apache/DBI.pm line 202.
>>Compilation failed in require at startup.pl line 11.
>>
>>Line 11 of startup.pl
>> 11   use Apache::DBI();
>>
>>Line 202 of DBI.pm
>> 202  ) if ($INC{'Apache.pm'} and Apache->module('Apache::Status'));
>>
>>Can you pelase tell me the possible cause of this error.
>>Apache::DBI is up to date as perl CPAN.
>>
> 
> this is fine. You are not running in mod_perl environment. A possible
> remedy is to:
> 
> if ($ENV{MOD_PERL}){
>  # put all the staff that requires mod_perl in here
>  # e.g. Apache::DBI
> }
> 

This is not a fix, this just makes sure that you don't attempt to run 
mod_perl modules if you haven't configured mod_perl.

This checking is placed into startup.pl. That's the file that you 
PerlRequire from httpd.conf.

Another simpler approach is to put the following at the top of the 
startup.pl file:

die "no mod_perl :(" unless $ENV{MOD_PERL};

You problem is that you probably haven't configured Apache to run 
mod_perl or you may even not installed the mod_perl at all. The mod_perl 
guide features a section with 1001 ways to check that mod_perl is 
running. See the ttp://perl.apache.org/guide/install.html chapter

Hope this clear this issue.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/