You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Enrico Sorcinelli <e....@pisa.iol.it> on 2003/12/04 15:32:05 UTC

[MP2] failed to resolve handler `Apache::PerlSections'

Hi all,

with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):

   ...
   LoadModule perl_module modules/mod_perl.so
   PerlModule Apache2
   PerlModule Apache::Status
   <Perl >
      use lib '/home/lib/perl';
   </Perl>
   ...

I've this error (the server doesn't start at all):

[Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
<Perl> handler Apache::PerlSections failed with status=500 

The same directives work fine with until mp2 1.9910.

Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
<Perl ></Perl> section in httpd.conf file, the server starts.

I don't think that this depend on Apache::Status because it's the same between
1.9910 and 19911.

by

	- Enrico


-------------8<---------- Start Bug Report ------------8<----------
2. Used Components and their Configuration:

*** mod_perl version 1.9911

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_APXS         => /usr/local/apache-2.0.47/bin/apxs
  MP_COMPAT_1X    => 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME      => mod_perl
  MP_USE_DSO      => 1
  MP_USE_STATIC   => 1


*** /usr/local/apache-2.0.47/bin/httpd -V
Server version: Apache/2.0.47
Server built:   Oct 26 2003 15:02:00
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local/apache-2.0.47"
 -D SUEXEC_BIN="/usr/local/apache-2.0.47/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.22, archname=i686-linux-thread-multi
    uname='linux sorcinelli 2.4.22 #6 tue sep 2 17:43:01 pdt 2003 i686 unknown unknown gnulinux '
    config_args='-des -Dprefix=/usr/local -Dusethreads'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFS
    optimize='-O3',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.2.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
 
 
Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Oct 26 2003 10:34:52
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /usr/local/lib/perl5/5.8.1/i686-linux-thread-multi
    /usr/local/lib/perl5/5.8.1
    /usr/local/lib/perl5/site_perl/5.8.1/i686-linux-thread-multi
    /usr/local/lib/perl5/site_perl/5.8.1
    /usr/local/lib/perl5/site_perl
    .
 

This report was generated by t/REPORT on Thu Dec  4 13:19:20 2003 GMT.
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Stas Bekman <st...@stason.org>.
Philippe M. Chiasson wrote:

>>>>>The problem seems to be as following: Apache::Status somehow 
>>>>>autovivifies Apache::PerlSections stash, while Apache/PerlSections.pm 
>>>>>wasn't loaded yet. That's why preloading Apache::PerlSections solves 
>>>>>the problem. Our code does not attempt to load packages whose stashes 
>>>>>exist, which is obviously wrong. I'll post a patch soonish. I think 
>>>>>instead of checking for the stash, we need to check %INC.
> 
> [...]
> 
>>>I think it at least gives users more control, rather than having obscure 
>>>problems when an autovivified stash will prevent the package loading. 
>>>Like in the case posted by Enrico.
>>
>>Or may be we should do the following:
>>
>>If the package is not loaded (not in %INC), try to load it, but don't bail out 
>>if it fails (like in the case with Unloaded). Next try to lookup the stash, if 
>>it's found (which should be the case with Unloaded, since Loaded will load it) 
>>, then move on, and only if the stash is not found bail out with the loading 
>>failure error?
> 
> 
> Sounds to me like a pretty good way to do what the user would expects
> ;-) But I wonder, how exactly does Perl do this internally when I do
> "use Module", and could we not reuse that ?

It only checks %INC.

perl -le '$Foo::Bar::x = 1; require Foo::Bar'
Can't locate Foo/Bar.pm in @INC

We could do the same, but then we will have to drop the 
magic-behind-the-scene-loading of Foo::Bar when Foo::Bar::handler is 
configured in httpd.conf. Currently we require to preload the module 
explicitly only if a different from ::handler sub is used. (And a few other 
cases, like filters)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by "Philippe M. Chiasson" <go...@cpan.org>.
On Fri, 2003-12-05 at 20:46, Stas Bekman wrote:
> Stas Bekman wrote:
> > Stas Bekman wrote:
> > 
> >> Stas Bekman wrote:
> >> [...]
> >>
> >>> The problem seems to be as following: Apache::Status somehow 
> >>> autovivifies Apache::PerlSections stash, while Apache/PerlSections.pm 
> >>> wasn't loaded yet. That's why preloading Apache::PerlSections solves 
> >>> the problem. Our code does not attempt to load packages whose stashes 
> >>> exist, which is obviously wrong. I'll post a patch soonish. I think 
> >>> instead of checking for the stash, we need to check %INC.
[...]
> > 
> > I think it at least gives users more control, rather than having obscure 
> > problems when an autovivified stash will prevent the package loading. 
> > Like in the case posted by Enrico.
> 
> Or may be we should do the following:
> 
> If the package is not loaded (not in %INC), try to load it, but don't bail out 
> if it fails (like in the case with Unloaded). Next try to lookup the stash, if 
> it's found (which should be the case with Unloaded, since Loaded will load it) 
> , then move on, and only if the stash is not found bail out with the loading 
> failure error?

Sounds to me like a pretty good way to do what the user would expects
;-) But I wonder, how exactly does Perl do this internally when I do
"use Module", and could we not reuse that ?

> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org
-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'

Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Stas Bekman wrote:
> 
>> Stas Bekman wrote:
>> [...]
>>
>>> The problem seems to be as following: Apache::Status somehow 
>>> autovivifies Apache::PerlSections stash, while Apache/PerlSections.pm 
>>> wasn't loaded yet. That's why preloading Apache::PerlSections solves 
>>> the problem. Our code does not attempt to load packages whose stashes 
>>> exist, which is obviously wrong. I'll post a patch soonish. I think 
>>> instead of checking for the stash, we need to check %INC.
>>
>>
>>
>> It was a bit trickier than I thought, but now the code is even simpler 
>> to follow. This should solve your problem Enrico. 'make test' pass 
>> 100% with this patch.
> 
> 
> So what do you think? Should we go with this change (checking %INC) or 
> not? The only drawback I can think of is that if you define a handler 
> without loading its package you may need to mess with %INC as in the 
> example below:
> 
> httpd.conf
> ----------
> PerlModule Loaded
> PerlWhateverHandler Loaded::handler
> PerlWhateverHandler NotLoaded::handler
> 
> Loaded.pm (which contains Loaded and also NotLoaded packages)
> ---------
> package Loaded;
> ...
> sub handler {...}
> ...
> package NotLoaded;
> $INC{'NotLoaded.pm'} = __FILE__;
> sub handler {...}
> 1;
> 
> if %INC is not updated to include the key 'NotLoaded.pm', mp2 will try 
> to load NotLoaded.pm, which doesn't exist.
> 
> I think it at least gives users more control, rather than having obscure 
> problems when an autovivified stash will prevent the package loading. 
> Like in the case posted by Enrico.

Or may be we should do the following:

If the package is not loaded (not in %INC), try to load it, but don't bail out 
if it fails (like in the case with Unloaded). Next try to lookup the stash, if 
it's found (which should be the case with Unloaded, since Loaded will load it) 
, then move on, and only if the stash is not found bail out with the loading 
failure error?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Stas Bekman wrote:
> [...]
> 
>> The problem seems to be as following: Apache::Status somehow 
>> autovivifies Apache::PerlSections stash, while Apache/PerlSections.pm 
>> wasn't loaded yet. That's why preloading Apache::PerlSections solves 
>> the problem. Our code does not attempt to load packages whose stashes 
>> exist, which is obviously wrong. I'll post a patch soonish. I think 
>> instead of checking for the stash, we need to check %INC.
> 
> 
> It was a bit trickier than I thought, but now the code is even simpler 
> to follow. This should solve your problem Enrico. 'make test' pass 100% 
> with this patch.

So what do you think? Should we go with this change (checking %INC) or not? 
The only drawback I can think of is that if you define a handler without 
loading its package you may need to mess with %INC as in the example below:

httpd.conf
----------
PerlModule Loaded
PerlWhateverHandler Loaded::handler
PerlWhateverHandler NotLoaded::handler

Loaded.pm (which contains Loaded and also NotLoaded packages)
---------
package Loaded;
...
sub handler {...}
...
package NotLoaded;
$INC{'NotLoaded.pm'} = __FILE__;
sub handler {...}
1;

if %INC is not updated to include the key 'NotLoaded.pm', mp2 will try to load 
NotLoaded.pm, which doesn't exist.

I think it at least gives users more control, rather than having obscure 
problems when an autovivified stash will prevent the package loading. Like in 
the case posted by Enrico.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
[...]
> The problem seems to be as following: Apache::Status somehow 
> autovivifies Apache::PerlSections stash, while Apache/PerlSections.pm 
> wasn't loaded yet. That's why preloading Apache::PerlSections solves the 
> problem. Our code does not attempt to load packages whose stashes exist, 
> which is obviously wrong. I'll post a patch soonish. I think instead of 
> checking for the stash, we need to check %INC.

It was a bit trickier than I thought, but now the code is even simpler to 
follow. This should solve your problem Enrico. 'make test' pass 100% with this 
patch.

Index: src/modules/perl/modperl_mgv.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v
retrieving revision 1.27
diff -u -r1.27 modperl_mgv.c
--- src/modules/perl/modperl_mgv.c	18 Sep 2003 07:58:46 -0000	1.27
+++ src/modules/perl/modperl_mgv.c	5 Dec 2003 01:06:47 -0000
@@ -181,6 +181,31 @@
  }
  #endif

+
+static void package2filename(apr_pool_t *p, const char *package,
+                             char **filename, int *len)
+{
+    *filename = apr_palloc(p, (strlen(package)+4)*sizeof(char));
+    const char *s;
+    char *d;
+
+    for (s = package, d = *filename; *s; s++, d++) {
+        if (*s == ':' && s[1] == ':') {
+            *d = '/';
+            s++;
+        }
+        else {
+            *d = *s;
+        }
+    }
+    *d++ = '.';
+    *d++ = 'p';
+    *d++ = 'm';
+    *d   = '\0';
+
+    *len = d - *filename;
+}
+
  /* currently used for complex filters attributes parsing */
  /* XXX: may want to generalize it for any handlers */
  #define MODPERL_MGV_DEEP_RESOLVE(handler, p) \
@@ -259,25 +284,44 @@
          }
      }

-    if (!(stash || (stash = gv_stashpv(name, FALSE))) &&
-        MpHandlerAUTOLOAD(handler)) {
-        MP_TRACE_h(MP_FUNC,
-                   "package %s not defined, attempting to load\n", name);
-
-        if (modperl_require_module(aTHX_ name, FALSE)) {
-            MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);
-            if (!(stash = gv_stashpv(name, FALSE))) {
-                MP_TRACE_h(MP_FUNC, "%s package still does not exist\n",
-                           name);
+    if (!stash && MpHandlerAUTOLOAD(handler)) {
+        int len;
+        char *filename;
+        SV **svp;
+
+        package2filename(p, name, &filename, &len);
+        svp = hv_fetch(GvHVn(PL_incgv), filename, len, 0);
+
+        if (!(svp && *svp != &PL_sv_undef)) { /* not in %INC */
+            MP_TRACE_h(MP_FUNC,
+                       "package %s not in %INC, attempting to load '%s'\n",
+                       name, filename);
+
+            if (modperl_require_module(aTHX_ name, FALSE)) {
+                MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);
+            }
+            else {
+                MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
                  return 0;
              }
          }
          else {
-            MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
-            return 0;
+            MP_TRACE_h(MP_FUNC, "package %s seems to be loaded\n"
+                       "  $INC{%s)='%s';\n",
+                       name, filename, SvPV_nolen(*svp));
          }
      }
-
+
+    /* try to lookup the stash only after loading the module, to avoid
+     * the case where a stash is autovivified by a user before the
+     * module was loaded, preventing from loading the module
+     */
+    if (!(stash || (stash = gv_stashpv(name, FALSE)))) {
+        MP_TRACE_h(MP_FUNC, "package %s seems to be loaded, "
+                   "but can't find its stash\n", name);
+        return 0;
+    }
+
      if ((gv = gv_fetchmethod(stash, handler_name)) && (cv = GvCV(gv))) {
          if (CvFLAGS(cv) & CVf_METHOD) { /* sub foo : method {}; */
              MpHandlerMETHOD_On(handler);

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Stas Bekman <st...@stason.org>.
Enrico Sorcinelli wrote:
> Hi all,
> 
> with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):
> 
>    ...
>    LoadModule perl_module modules/mod_perl.so
>    PerlModule Apache2
>    PerlModule Apache::Status
>    <Perl >
>       use lib '/home/lib/perl';
>    </Perl>
>    ...
> 
> I've this error (the server doesn't start at all):
> 
> [Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
> Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
> <Perl> handler Apache::PerlSections failed with status=500 
> 
> The same directives work fine with until mp2 1.9910.
> 
> Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
> <Perl ></Perl> section in httpd.conf file, the server starts.
> 
> I don't think that this depend on Apache::Status because it's the same between
> 1.9910 and 19911.

Thank you Enrico for the report.

The problem seems to be as following: Apache::Status somehow autovivifies 
Apache::PerlSections stash, while Apache/PerlSections.pm wasn't loaded yet. 
That's why preloading Apache::PerlSections solves the problem. Our code does 
not attempt to load packages whose stashes exist, which is obviously wrong. 
I'll post a patch soonish. I think instead of checking for the stash, we need 
to check %INC.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> 
> I'm little bit surprised because in mp2 1.9910 the same configuration works.

yeah.  gozer is the guy to ask about what has changed, though.

> 
> Moreover also works in mp2 1.9911 (without adding explicitly "PerlModule
> Apache::PerlSections") this configuration:
> 
>    LoadModule perl_module modules/mod_perl.so
>    PerlModule Apache2
>    <Perl >
>       use lib '/home/lib/perl';
>    </Perl>
>    PerlModule Apache::Status

yes, that's what I meant by making sure Apache::Status doesn't require()
Apache::PerlSections - here <Perl> is doing the require()ing via
modperl_mgv* routines, which appear to add some magic behind the scenes.

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Enrico Sorcinelli <e....@pisa.iol.it>.
On Thu, 04 Dec 2003 09:37:13 -0500
Geoffrey Young <ge...@modperlcookbook.org> wrote:

> 
> 
> Enrico Sorcinelli wrote:
> > Hi all,
> > 
> > with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):
> > 
> >    ...
> >    LoadModule perl_module modules/mod_perl.so
> >    PerlModule Apache2
> >    PerlModule Apache::Status
> >    <Perl >
> >       use lib '/home/lib/perl';
> >    </Perl>
> >    ...
> > 
> > I've this error (the server doesn't start at all):
> > 
> > [Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
> > Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
> > <Perl> handler Apache::PerlSections failed with status=500 
> > 
> > The same directives work fine with until mp2 1.9910.
> > 
> > Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
> > <Perl ></Perl> section in httpd.conf file, the server starts.
> 
> because PerlSections::handler() is a method handler, you need to
> 
> PerlModule Apache::PerlSections
> 
> so that the require() in Apache::Status isn't the one to load the module.

Thanks, I've seen: maybe it's needed to document this in Apache::Status docs (or
fix it at all)?

I'm little bit surprised because in mp2 1.9910 the same configuration works.

Moreover also works in mp2 1.9911 (without adding explicitly "PerlModule
Apache::PerlSections") this configuration:

   LoadModule perl_module modules/mod_perl.so
   PerlModule Apache2
   <Perl >
      use lib '/home/lib/perl';
   </Perl>
   PerlModule Apache::Status

by

	- Enrico


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [MP2] failed to resolve handler `Apache::PerlSections'

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Enrico Sorcinelli wrote:
> Hi all,
> 
> with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):
> 
>    ...
>    LoadModule perl_module modules/mod_perl.so
>    PerlModule Apache2
>    PerlModule Apache::Status
>    <Perl >
>       use lib '/home/lib/perl';
>    </Perl>
>    ...
> 
> I've this error (the server doesn't start at all):
> 
> [Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
> Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
> <Perl> handler Apache::PerlSections failed with status=500 
> 
> The same directives work fine with until mp2 1.9910.
> 
> Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
> <Perl ></Perl> section in httpd.conf file, the server starts.

because PerlSections::handler() is a method handler, you need to

PerlModule Apache::PerlSections

so that the require() in Apache::Status isn't the one to load the module.

in mp1 any kind of pre-loading was ok for method handlers, but this leads me
to believe that PerlModule is somehow required.  I dunno, though.

HTH

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org