You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Eric Adum <er...@gmail.com> on 2007/06/26 18:33:29 UTC
Apache2::Request->new fails silently?
Hi,
I'm trying to write a handler for mod_perl 2.0.
I have a sub of the form
sub handler {
my $r = shift;
my $req = Apache2::Request->new($r);
print "Something.";
return Apache2::Const::OK();
}
When I go to the URL associated with the handler, I get a blank page,
nothing in the error log.
However, if I remove the "my $req = Apache2::Request->new($r);" line, it
prints out 'Something.' as it is supposed to.
I tried using Data::Dumper to dump $r, and it is an Apache2::RequestRec
object as it is supposed to be:
$VAR1 = bless( do{\(my $o = 10005704)}, 'Apache2::RequestRec' );
Even if I put a 'die' statement after the Apache2::Request->new call, the
program doesn't die, it just returns a blank page. It seems to be some sort
of silent failure within the new() method of Apache2::Request, but I have no
idea of how to debug this.
I'm using the binaries of Apache2, mod_perl, etc. provided by Debian etch:
ii apache2 2.2.3-4
ii libapache2-mod-apreq2 2.08-4
ii libapache2-mod-perl2 2.0.2-2.4
Any ideas on what I can do?
TIA,
Eric
Re: Apache2::Request->new fails silently?
Posted by Eric Adum <er...@gmail.com>.
Ack -- ignore that, problem solved. I wasn't loading the apreq2 module in my
apache2.conf file.
On 6/26/07, Eric Adum <er...@gmail.com> wrote:
>
> Hi,
>
> I'm trying to write a handler for mod_perl 2.0.
>
> I have a sub of the form
>
> sub handler {
> my $r = shift;
> my $req = Apache2::Request->new($r);
> print "Something.";
> return Apache2::Const::OK();
> }
>
> When I go to the URL associated with the handler, I get a blank page,
> nothing in the error log.
>
> However, if I remove the "my $req = Apache2::Request->new($r);" line, it
> prints out 'Something.' as it is supposed to.
>
> I tried using Data::Dumper to dump $r, and it is an Apache2::RequestRec
> object as it is supposed to be:
> $VAR1 = bless( do{\(my $o = 10005704)}, 'Apache2::RequestRec' );
>
> Even if I put a 'die' statement after the Apache2::Request->new call, the
> program doesn't die, it just returns a blank page. It seems to be some sort
> of silent failure within the new() method of Apache2::Request, but I have no
> idea of how to debug this.
>
> I'm using the binaries of Apache2, mod_perl, etc. provided by Debian etch:
> ii apache2 2.2.3-4
> ii libapache2-mod-apreq2 2.08-4
> ii libapache2-mod-perl2 2.0.2-2.4
>
> Any ideas on what I can do?
>
> TIA,
> Eric
>