mod_perl error: Can't locate object method "boot"

Gunnar Hjalmarsson noreply at gunnar.cc
Sat May 15 19:55:08 UTC 2004


Gunnar Hjalmarsson wrote:
> running a simple "Hello World" script resulted in "Internal Server
> Error" and this complaint in the error log:
> 
> failed to resolve handler `ModPerl::Registry'
> Can't locate object method "boot" via package "mod_perl" at 
> /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/Apache/Log.pm
> line 6.
> Compilation failed in require at 
> /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
> line 21.

I have made some progress. This is the content of @INC if you run a
Perl program as a plain CGI script:

   /usr/lib/perl5/5.8.1/i386-linux-thread-multi
   /usr/lib/perl5/5.8.1
   /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
   /usr/lib/perl5/site_perl/5.8.1
   /usr/lib/perl5/site_perl
   /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
   /usr/lib/perl5/vendor_perl/5.8.1
   /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
   /usr/lib/perl5/vendor_perl/5.8.0
   /usr/lib/perl5/vendor_perl
   /usr/lib/perl5/5.8.1/i386-linux-thread-multi
   /usr/lib/perl5/5.8.1

There are Apache/Log.pm files (not identical) both in
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi and in
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi. The file
that should be loaded is the one at the latter location. I have no
idea why things have been set up that way, but that's how it is.

What I did was loading a startup.pl file when starting the server with
the following line:

   use lib '/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi';

By doing so, that directory was made the first directory in @INC when
running a program under mod_perl, and the correct version of
Apache/Log.pm got loaded.

To me, this appears to be a decent solution. However, I feel that I'm
out on deep water here, and if somebody is able to share some insight,
it would be greatly appreciated.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl





More information about the redhat-list mailing list