[mp2] Problems with Apache::Request
[prev]
[thread]
[next]
[Date index for 2005/04/29]
I've been having problems with the Apache::Request module (from
libapreq2) and mod_perl2 for a while now and I've not come up with a
decent solution. I am using the Debian packages but I didn't get a
response from the maintainer so I hope someone here can enlighten me.
This is with libapreq2-2.04_03-dev and mod_perl2 1.999.21-1 but I've
had similar problems with earlier versions.
I have a very simple mod_perl handler:
package Jadevine::Hello;
use Apache2;
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Request ();
use Apache::Const -compile => qw(OK);
sub handler {
my $r = shift;
$r->content_type('text/plain');
print "mod_perl 2.0 rocks!\n";
return Apache::OK;
}
1;
This is loaded in the Apache config with:
<Location /Hello>
SetHandler perl-script
PerlResponseHandler Jadevine::Hello
</Location>
If I remove the "use Apache::Request" line everything works
fine. Leaving it there, or actually trying to use the methods provided
by the module give the error:
[error] [client 127.0.0.1] failed to resolve handler `Jadevine::Hello': Apache::Request: httpd must load mod_apreq.so first at /usr/lib/perl5/Apache2/Apache/Request.pm line 31.\nCompilation failed in require at /usr/local/lib/site_perl/Jadevine/Hello.pm line 5.\nBEGIN failed--compilation aborted at /usr/local/lib/site_perl/Jadevine/Hello.pm line 5.\nCompilation failed in require at (eval 3) line 3.\n
I have tried putting the "use" statements in every order imaginable
without any joy so I'm not sure what the error is trying to get me to
do to correct the problem.
I can see where the error comes from in the Apache::Request code:
my $env = __PACKAGE__->env || '';
if ($mod_perl::VERSION > 1.99) {
die __PACKAGE__ . ": httpd must load mod_apreq.so first"
if $env ne "Apache::RequestRec";
}
For the record $env contains 'APR::Pool', not sure if this is what
should be there or not.
Any help would be much appreciated, thanks in advance,
Stephen Quinney
 |
[mp2] Problems with Apache::Request
Stephen Quinney 11:56 on 29 Apr 2005
|