Comment 6 for bug 4727

Revision history for this message
GrantMcLean (grant-mclean) wrote :

When I attempt to use Apache::Request from my Apache config, I get the following error:

Can't load '/usr/lib/perl5/auto/Apache/Request/Request.so' for module Apache::Request: libapreq.so: cannot open shared object file: No such file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.
 at /usr/lib/perl5/mod_perl.pm line 14
Compilation failed in require at /etc/apache-perl/conf.d/hoiho.conf line 13.
BEGIN failed--compilation aborted at /etc/apache-perl/conf.d/hoiho.conf line 13.

Here's an example which works under Debian Sarge. Save these lines in a file called /etc/apache-perl/conf.d/time.conf:

  <Perl>
    package ModPerl::Time;
    use Apache::Constants qw(:common);
    use Apache::Request ();

    sub handler {
        my $r = shift;
        my $apr = Apache::Request->new($r);

        print "Content-type: text/plain\n\n";
        print "The time is now: " . localtime . "\n";
        return OK;
    }
  </Perl>

  <Location /time>
      SetHandler perl-script
      PerlHandler ModPerl::Time
      PerlSendHeader On
  </Location>

If the lines referring to Apache request are removed, the code works via the url http://localhost/time

$ ls -l /usr/lib/perl5/auto/Apache/Request/Request.so /usr/lib/perl5/auto/libapreq/libapreq.so
-rw-r--r-- 1 root root 35452 2004-08-14 03:37 /usr/lib/perl5/auto/Apache/Request/Request.so
-rw-r--r-- 1 root root 17984 2004-08-14 03:37 /usr/lib/perl5/auto/libapreq/libapreq.so
$