2

好的,所以我正在尝试使用 mod_perl 设置 Dispatcher,但我真的不知道我做错了什么。我相当肯定问题出在我的 mod_perl 配置上。以下是我认为相关的内容:

Apache 目录配置

<Directory  "C:/Documents and Settings/frew/My Documents/acd">
   SetHandler perl-script
   PerlHandler ACD::Dispatch
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    DirectoryIndex Default.html
</Directory>

注意: ACD::Dispatch 在 acd/ACD 中。

ACD::调度

package ACD::Dispatch;
use base 'CGI::Application::Dispatch';
sub dispatch_args {
    return {
        prefix  => 'ACD',
        table   => [
        ''                => { app => 'Controller', rm => 'awesome' },
        ':app/:rm'        => { },
        ],
    };
}

可能最重要的是,Apache 错误:

[Mon Jan 12 17:42:08 2009] [error] [client 10.6.1.73] failed to resolve handler `ACD::Dispatch': Can't locate ACD/Dispatch.pm in @INC (@INC contains: C:/usr/site/lib C:/usr/lib . C:/Program Files/Apache Software Foundation/Apache2.2) at (eval 3) line 3.\n

谢谢你的帮助!

更新:我需要将此添加到我的 Apache 配置中:

<Perl>
   use lib '/path/to/acd';
</Perl>
4

1 回答 1

4

好吧,根据错误消息:

ACD::Dispatch:无法在 @INC 中找到 ACD/Dispatch.pm(@INC 包含:C:/usr/site/lib C:/usr/lib。C:/Program Files/Apache Software Foundation/Apache2.2

你说的事实:

ACD::Dispatch 位于 acd/ACD 中。

看起来您需要使用其绝对路径名将“acd”目录放在@INC 路径中。

虽然你可能会想'。在@INC 上,那应该是你的acd目录,我不认为它是,在 mod_perl 下。例如,参见这个讨论

于 2009-01-13T15:45:54.357 回答