I've been trying to figure out how to use Apache2::Request/RequestRec/Upload for the past couple of days and I've run into an interesting mod_perl problem. Tonight after a lot of struggle I thought of pasting a code snippet from the Apache.org website:

use Apache2::Upload; $req = Apache2::Request->new($r); $upload = $req->upload("foo"); $size = $upload->size; # three methods to get at the upload's contents ... slurp, fh, io $upload->slurp($slurp_data); read $upload->fh, $fh_data, $size; ok $slurp_data eq $fh_data; my $io = $upload->io; print while <$io>;

Unfortunately while I would have sworn it ran when I first tried it, I'm now getting a 500 Internal Server Error and the following in my log (no matter what test scripts I run, not just this one):

[Wed Sep 16 22:23:32 2009] [error] [client ::1] dyld: lazy symbol bind +ing failed: Symbol not found: _modperl_xs_sv2request_rec [Wed Sep 16 22:23:32 2009] [error] [client ::1] Referenced from: /Li +brary/Perl/5.8.8/darwin-thread-multi-2level/auto/APR/Request/Apache2/ +Apache2.bundle [Wed Sep 16 22:23:32 2009] [error] [client ::1] Expected in: dynamic + lookup [Wed Sep 16 22:23:32 2009] [error] [client ::1] [Wed Sep 16 22:23:32 2009] [error] [client ::1] dyld: Symbol not found +: _modperl_xs_sv2request_rec [Wed Sep 16 22:23:32 2009] [error] [client ::1] Referenced from: /Li +brary/Perl/5.8.8/darwin-thread-multi-2level/auto/APR/Request/Apache2/ +Apache2.bundle [Wed Sep 16 22:23:32 2009] [error] [client ::1] Expected in: dynamic + lookup [Wed Sep 16 22:23:32 2009] [error] [client ::1] [Wed Sep 16 22:23:32 2009] [error] [client ::1] Premature end of scrip +t headers: test.cgi

Can anyone tell me what I'm missing? Make test ran 100% okay, and my httpd.conf does include "LoadModule perl_module modules/mod_perl.so" and "LoadModule apreq_module modules/mod_apreq2.so".

Many thanks!

In reply to mod_perl lib problem by daveklingler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.