You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by The BOFH <Th...@nc.rr.com> on 2000/11/28 02:25:53 UTC

Apache->server_root_relative not found?




Installed Apache with mod_perl on Mandrake 7.2:

[Mon Nov 27 17:44:43 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01 
mod_ssl/2.7.1 OpenSSL 0.9.6 configured -- resuming normal operations

Installed Apache::MP3 from Lincoln Stein, that works fine.

In an effort to start learning the details of mod_perl, I bought the 
Writing Apache Modules... book and started following the directions:

In /usr/local/apache/conf/httpd.conf
<IfModule mod_perl.c>
   Include conf/modperl.conf
</IfModule>

In conf/modperl.conf
PerlRequire  conf/modperl_startup.pl
PerlFreshRestart On


In modperl_startup.pl (chmod 755)
#!/usr/bin/perl

BEGIN {
   use Apache ();
   use lib Apache->server_root_relative('libperl');   ## 
/usr/local/apache/libperl created
}

use Apache::Registry ();
use Apache::Constants ();
use CGI qw (-compile :all);
use CGI::Carp ();

1;

Doing a graceful with apachectl causes a core dump.  Nothing is written to 
error_log.

perl -cw modperl_startup.pl returns:

Can't locate object method "server_root_relative" via package "Apache" at 
conf/modperl_startup.pl line 5.  mod_perl was built with EVERYTHING=1.

Is there something I missed?  Some module I should be installing?  I 
checked the Errata for the book without success.

Any help would be greatly appreciated.

S


Re: Apache->server_root_relative not found?

Posted by Doug MacEachern <do...@covalent.net>.
On Mon, 27 Nov 2000, The BOFH wrote:
 
> BEGIN {
>    use Apache ();
>    use lib Apache->server_root_relative('libperl');   ## 
> /usr/local/apache/libperl created
> }
... 
> perl -cw modperl_startup.pl returns:
> 
> Can't locate object method "server_root_relative" via package "Apache" at 
> conf/modperl_startup.pl line 5.  mod_perl was built with EVERYTHING=1.

Apache-> methods are only available inside the server, not on the command
line.  perl -c will pass if you remove the BEGIN block, which is not
required in either case.