You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "michael watson (IAH-C)" <mi...@bbsrc.ac.uk> on 2007/04/11 16:23:22 UTC

Can't locate object method "is_threaded" via package "Apache2::MPM"

I'm running Apache/2.2.4 (Unix) mod_perl/2.0.3 Perl/v5.8.0 configured.

BEGIN in Apache2::SizeLimit has the code:

    die "Apache2::SizeLimit at the moment works only with non-threaded
MPMs"
        if Apache2::MPM->is_threaded();

Yet if I run:

%> perl
use Apache2::MPM;
print Apache2::MPM->is_threaded();

I get:

Can't locate object method "is_threaded" via package "Apache2::MPM" at -
line 2.

The site I am trying to install relies on a modperl startup script, and
it is failing because it cannot find the is_threaded method in
Apache2:MPM.

What am I missing?

Thanks
Mick

The information contained in this message may be confidential or legally
privileged and is intended solely for the addressee. If you have
received this message in error please delete it & notify the originator
immediately.
Unauthorised use, disclosure, copying or alteration of this message is
forbidden & may be unlawful. 
The contents of this e-mail are the views of the sender and do not
necessarily represent the views of the Institute. 
This email and associated attachments has been checked locally for
viruses but we can accept no responsibility once it has left our
systems.
Communications on Institute computers are monitored to secure the
effective operation of the systems and for other lawful purposes. 

Re: Can't locate object method "is_threaded" via package "Apache2::MPM"

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
michael watson (IAH-C) wrote:
> I'm running Apache/2.2.4 (Unix) mod_perl/2.0.3 Perl/v5.8.0 configured.
> 
> BEGIN in Apache2::SizeLimit has the code:
> 
>     die "Apache2::SizeLimit at the moment works only with non-threaded
> MPMs"
>         if Apache2::MPM->is_threaded();

nothing wrong with that.

> 
> Yet if I run:
> 
> %> perl
> use Apache2::MPM;
> print Apache2::MPM->is_threaded();
> 
> I get:
> 
> Can't locate object method "is_threaded" via package "Apache2::MPM" at -
> line 2.

of course - you can't really do much with Apache2:: modules outside of a
running mod_perl environment.  in this case Apache2::MPM::is_threaded()
is an constant subroutine created at runtime when mod_perl can query the
running Apache server and figure out whether it is using some threaded
mpm or not.

> 
> The site I am trying to install relies on a modperl startup script, and
> it is failing because it cannot find the is_threaded method in
> Apache2:MPM.

hopefully, you're typing Apache2::MPM with two colons ;)

> 
> What am I missing?

if you have the mp2 sources and build available you can see Apache2::MPM
exercised by doing this:

  $ t/TEST t/api/query.t -v

the source for which is here

  t/response/TestAPI/query.pm

short of that, you might want to perldoc the Apache2::MPM manpage and
try calling show() in your startup script (in addition to is_threaded())
and see what happens.

--Geoff