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

I have installed mod_perl2 for windows, when ever i use
use Apache2::RequestRec;
Apache server does'nt start and logs error "Can't load Perl module Optrack for server localhost:80, exiting...
#!c:/Perl/bin package Optrack; use Apache2::RequestRec; use Apache2::Const; sub handler { my $r = shift; $r->content_type("text/html"); print "Hello World\n"; return Apache2::OK; } 1;
------
#httpd.conf #PrelRequire Optrack PerlRequire Optrack <Location /Optrack> SetHandler perl-script PerlResponseHandler Optrack::handler </Location>
any suggestons ?

Replies are listed 'Best First'.
Re: unable to load Apache2::RequestRec
by johngg (Canon) on Oct 05, 2006 at 13:39 UTC
    I know nothing about mod_perl set-up but in the httpd.conf listing should the first line be PerlRequire Optrack rather than PrelRequire Optrack? Just a guess.

    Cheers,

    JohnGG

      sorry for the type error, the error is not there in original httpd.conf.
Re: unable to load Apache2::RequestRec
by asz (Pilgrim) on Oct 05, 2006 at 20:39 UTC

    i think Apache is unable to load your Optrack module, because it does not find it in @INC. try adding your path to the module in httpd.conf, something like this:

    PerlSwitches -I"C:\path\to\your\module\"

    then delete the line:

    PerlRequire Optrack

    and use your module from Apache like this:

    PerlModule Optrack

    you can read about passing arguments to Perl from Apache in the mod_perl 2: Server Configuration Guide: Perl Switches.

    hope this helps

    :)))))

    <update time="Thu Oct 5 23:48:41 EEST 2006">
    specified the use of PerlModule instead of PerlRequire
    </update>

      I c more strange problems with mod_perl on windows. Now it's not able to load CGI.pm, i tried commenting the use Apache2::RequestRec, it worked. I don't know what i c ahead, i thing using PerlSwitches -I"C:\path\to\your\module\" should solve my problem.