Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Static to mod_perl2 (not mod_perl)

by hacker (Priest)
on Aug 31, 2007 at 11:08 UTC ( [id://636294] : perlquestion . print w/replies, xml ) Need Help??

hacker has asked for the wisdom of the Perl Monks concerning the following question:

I have an existing website that was (until recently) running with mod_perl under Apache 1.3.x, and worked well.

I've migrated the servers to newer hardware and Apache 2..x, and had to "unroll" the site, because none of the same/similar constructs that worked with mod_perl worked with mod_perl2 (even the fallback of using Apache2::compat didn't seem to work.

Right now, I'm using the following:

#!/usr/bin/perl -w use strict; use diagnostics; use Apache2::Request; my $apr = Apache2::Request->new($r); $action = $apr->param('a');

This is currently taking the place of my previous $cgi->param('a') constructs. As I get more familiar with the Apache2::Request objects and methods, I'll add more of my code in.

Right now, its baby steps.

When I request the page using this code (with or without params), I receive:

perl: symbol lookup error: /usr/lib/perl5/auto/APR/Request/Apache2/ undefined symbol: modperl_xs_sv2request_rec

There is no other line number, error or warning.

I've Googled around without much luck. Lots of people with the error on BSD platforms, but I run Linux, and am using the upstream Debian Apache and libapreq2 packages.

Where other rock can I overturn to figure this out?

Update: I fetched the upstream source for libapreq2 and built it with the following params:

/usr/bin/perl Makefile.PL --with-apache2-apxs=/usr/bin/apxs2 --prefix=/usr --enable-perl-glue --with-perl=/usr/bin/perl

This compiles clean and all tests pass 100%, but I still receive the error above.

Replies are listed 'Best First'.
Re: Static to mod_perl2 (not mod_perl)
by perrin (Chancellor) on Aug 31, 2007 at 12:11 UTC
    One thing to keep in mind is that works just fine with mod_perl 2 and you don't need to change your code to use libapreq2 unless you want to. Now, if you do want to use libapreq2, the best place to ask for help with this error is the mailing list, which you can find at

      My application works great with as it stands, but I wanted to turn it into a mod_perl2 application for the performance reasons (vs. using something like Memoize for example).

      Or are you saying that simply using and its associated objects within my application, automagically makes it a mod_perl2 application?

        I'm saying that works correctly in ModPerl::Registry and perl handlers, so you can write your mod_perl application using it. Apache2::Request is faster at parsing parameters than, but in real time the difference is pretty small.