我的 Apache 日志中出现“预期的令牌不存在"错误 [英] “Expected token not present” error in my Apache log

查看:21
本文介绍了我的 Apache 日志中出现“预期的令牌不存在"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站在带有 mod_perl 的 Apache 2 上运行,并使用 Mason 模板系统.我没有在我的网站中使用任何身份验证系统或任何会话,但有时(随机)我收到此错误:

My website runs on Apache 2 with mod_perl and uses the Mason template system. I am not using any authentication system or any sessions in my website, but sometimes (at random) I get this error:

服务器遇到内部错误或配置错误无法完成您的请求.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

请联系服务器管理员,webmaster@admin.org并通知他们错误发生的时间,以及您可能会做的任何事情已经做了可能导致错误的事情.

Please contact the server administrator, webmaster@admin.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

有关此错误的更多信息可在服务器错误中找到记录.

More information about this error may be available in the server error log.

此外,在运行时遇到 500 Internal Server Error 错误尝试使用 ErrorDocument 来处理请求.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

在错误日志中,对应的记录为:

In the error log, the corresponding record is:

[Mon Dec 19 09:34:26 2011] [error] [client 127.0.0.1] Expected token not present

服务器版本字符串:

Apache/2.2.8 (Ubuntu) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8 Server

我的浏览器发送了这个奇怪的 cookie:

My browsers sends this weird cookie:

Name:                   BC_BANDWIDTH
Content:                1324486772745,6811
Domain:                 example.org
Path:                   /
Send For:               Any kind of connection
Accessible to Script:   Yes
Created:                Wednesday, December 21, 2011 12:59:09 PM
Expires:                When I close my browser

当我删除它时,我可以重新加载我的页面并且它可以工作.然而,点击几下后,问题又出现了.

When I delete it, I can reload my page and it works. However after a couple of clicks the problem reappears.

为什么我的错误日志中出现错误?如何解决?

推荐答案

因为您在解决方案中省略了 return 语句,所以您还必须在 eval 块中圈出继续语句.否则,您可以期待第一次星座,其中在未定义的值上调用函数cookie_class"会引发异常.因此

Because you omit the return statement in your solution, you had to circle the proceeding statement in an eval block as well. Otherwise you can expect a first time constellation where a function "cookie_class" is called on an undefined value what would throw an exception. Therefore

另外更换

$jar->cookie_class(__PACKAGE__);

eval {$jar->cookie_class(__PACKAGE__)};

享受吧!

这篇关于我的 Apache 日志中出现“预期的令牌不存在"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆