如何使 CGI::Application::Dispatch 与 mod_perl 一起工作?

发布于 2024-07-11 21:43:46 字数 1334 浏览 6 评论 0原文

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

Apache Directory Config

<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::Dispatch

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>

Ok, so I am trying to set up a Dispatcher with mod_perl and I don't really know what I am doing wrong. I am fairly positive that the issue is with my mod_perl configuration. Here is what I think is relevant:

Apache Directory Config

<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>

Note: ACD::Dispatch is in acd/ACD.

ACD::Dispatch

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

And probably most importantly, the Apache errors:

[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

Thanks for any help!

Update: I needed to add this to my Apache config:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁的新欢旧爱 2024-07-18 21:43:46

好吧,根据错误消息:

ACD::Dispatch:找不到
@INC 中的 ACD/Dispatch.pm (@INC
包含: C:/usr/site/lib C:/usr/lib 。
C:/Program Files/Apache 软件
基金会/Apache2.2

以及您所说的事实:

ACD::Dispatch 位于 acd/ACD 中。

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

尽管你可能会认为“。” 位于 @INC 上,这应该是您的 acd 目录,但我不认为它是在 mod_perl 下。 例如,请参阅此讨论

Well, based on the error message:

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

and the fact that you said:

ACD::Dispatch is in acd/ACD.

It looks like you need to put the "acd" directory in the @INC path, using its absolute pathname.

Although you might think '.' is on @INC and that should be your acd directory, I don't that that it is, under mod_perl. See, for example, this discussion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文