基于 CakePHP 的应用程序在需要缓存类时抛出 500 服务器错误
我正在尝试运行一个基于 CakePHP 的应用程序。 就是这样: Newsletter Mailer v1.1
我正在尝试运行它这里:mailer.dasministerium.com
但正如你所看到的,我收到的只是 500 内部服务器错误。
我将此错误跟踪到文件:cake/libs/cache.php
第203行
$core = App::core();
$path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php';
if (file_exists($path)) {
require $path;
return true;
}
,其中第203行是:require $path;
要跟踪此错误,我之前就死了()d这条线,并收到我的 die() 消息。
此行之后的 die() 导致了 500 错误,但是在所需文件 (cake/libs/cache/file.php
) 中的 die() 也给了我 500。
所以整个事情真的在这个需求上崩溃了。
我正在运行 Ubuntu 8.04 LTS 64 位、PHP 5.2.4 (作为 apache 模块,而不是 fast-cgi)
有什么想法如何让它运行吗?
提前致谢! 大卫
编辑:
将所有错误打印到错误文件中后,我发现了这个:PHP 致命错误:第 83 行 /var/www/vhosts/dasministerium.com/subdomains/mailer/httpdocs/cake/libs/cache/file.php 中未找到“CakeLog”类
不幸的是,有此文件中根本没有引用 CakeLog
...所以:wtf?!
编辑 2:
var_dump(class_exists('CakeLog')); // this before the crashing
// require() returns true!
编辑最终版本!
它是一个 CakePHP <-> eAccelerator 问题....已解决
I'm trying to run a CakePHP based Application.
this is it: Newsletter Mailer v1.1
I'm trying to get this running here: mailer.dasministerium.com
But as you can see all I receive is a 500 Internal Server error.
I tracked this error down to file: cake/libs/cache.php
line 203
$core = App::core();
$path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php';
if (file_exists($path)) {
require $path;
return true;
}
where line 203 is: require $path;
To track this down I die()d befor this line, and got my die() message.
Die()ing after this line resulted in the 500 Error, but die()ing in that required file (cake/libs/cache/file.php
) gave me the 500 too.
So the whole thing is really crashing at that require thing.
I'm running Ubuntu 8.04 LTS 64Bit, PHP 5.2.4 (as apache module, NOT fast-cgi)
Any ideas how to get this running?
Thanks in advance!
David
EDIT:
After printing out all errors into the error-file i found this:PHP Fatal error: Class 'CakeLog' not found in /var/www/vhosts/dasministerium.com/subdomains/mailer/httpdocs/cake/libs/cache/file.php on line 83
Unfortnunately there is no reference at all to CakeLog
in this file... so: wtf?!
EDIT 2:
var_dump(class_exists('CakeLog')); // this before the crashing
// require() returns true!
EDIT FINAL!
Its a CakePHP <-> eAccelerator issue.... SOLVED
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
已解决:这是 eAccelerator 的错。用一点技巧修复了它...
解决方案:
打开
/cake/libs/cake-log.php
滚动到最底部,然后替换为:
就是这样:)
SOLVED: it was eAccelerator's fault. fixed it with a little hack...
Solution:
open
/cake/libs/cake-log.php
an scroll to the very bottom, then replacewith:
that's it :)
该解决方案适用于 Cake1.3(可能还有更新版本)。
1.2呢?
没有行: 。
cake_log.php 文件中
That solution is for Cake1.3 (and newer maybe).
What about 1.2?
There is no line:
in cake_log.php file.
我注意到,当控制器没有“视图”时,cakephp 2.x 可能会返回 http 状态 500。这似乎是“随机发生的”,因为一些没有视图的控制器返回http状态200。
无论如何,要解决这个http状态500问题,请确保所有控制器都有一个与之关联的视图(您将在底部看到一个错误)如果没有与控制器关联的视图,则显示该页面)。
I notice that cakephp 2.x may return http status 500 when there is no 'view' to the controller. It seems to be 'randomly occuring', as some Controllers without a view returns http status 200.
Anyway, to solve this http status 500 problem, ensure all your controllers has a view associated with it (you will see an error at the bottom of the page if there is no view associated with a controller).