Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Static CGI.pm to mod_perl2 (not mod_perl)

by hacker (Priest)
on Aug 31, 2007 at 11:08 UTC ( #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/Apache2.so: 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.

Comment on Static CGI.pm to mod_perl2 (not mod_perl)
Select or Download Code
Re: Static CGI.pm 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 CGI.pm 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 http://httpd.apache.org/apreq/.

      My application works great with CGI.pm 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 CGI.pm and its associated objects within my application, automagically makes it a mod_perl2 application?

        I'm saying that CGI.pm 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 CGI.pm, but in real time the difference is pretty small.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://636294]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-12-25 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls