在 Cakephp 2.1.1 稳定版本中使用 Auth 组件获得 500 内部服务器错误


Getting 500 internal server error with Auth component in Cakephp 2.1.1 stable version

我的 cakephp 应用程序 2.1.1 目前在 Cent OS 服务器上运行,每当我尝试使用 Auth 组件登录系统时,我都会随机收到 500 个内部服务器错误。

我认为这与Apache httpd.conf设置有关,所以我从无更改为AllowOverride All,但它一直在发生。

我不确定这是否与.htaccess有关,还是与Cakephp有关。

这实际上是 Cakephp 2.1.1 的错误吗?

更新 12/APR/2012

我在日志中遇到以下错误:

2012-04-11 16:26:27 Warning: Warning (512): _cake_model_ cache was unable to write 'default_ticketing_jobs_localgovstategovfedjobs' to Apc cache in [/home/commstrat2_web/html/ticket/lib/Cake/Cache/Cache.php, line 306]
Trace:
Cache::write() - CORE/Cake/Cache/Cache.php, line 306
DataSource::_cacheDescription() - CORE/Cake/Model/Datasource/DataSource.php, line 306
Mysql::describe() - CORE/Cake/Model/Datasource/Database/Mysql.php, line 334
Model::schema() - CORE/Cake/Model/Model.php, line 1281
DboSource::fields() - CORE/Cake/Model/Datasource/DboSource.php, line 2180
DboSource::read() - CORE/Cake/Model/Datasource/DboSource.php, line 1027
Model::find() - CORE/Cake/Model/Model.php, line 2635
JobsLocalgovstategovfedjobsController::index() - APP/Controller/JobsLocalgovstategovfedjobsController.php, line 38
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 488
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85
[main] - APP/webroot/index.php, line 96
2012-04-11 16:26:30 Warning: Warning (512): _cake_core_ cache was unable to write 'file_map' to Apc cache in [/home/commstrat2_web/html/ticket/lib/Cake/Cache/Cache.php, line 306]
Trace:
Cache::write() - CORE/Cake/Cache/Cache.php, line 306
App::shutdown() - CORE/Cake/Core/App.php, line 884
[main] - [internal], line ??
2012-04-11 16:26:30 Warning: Warning (512): _cake_core_ cache was unable to write 'method_cache' to Apc cache in [/home/commstrat2_web/html/ticket/lib/Cake/Cache/Cache.php, line 306]
Trace:
Cache::write() - CORE/Cake/Cache/Cache.php, line 306
DboSource::__destruct() - CORE/Cake/Model/Datasource/DboSource.php, line 3148
[main] - [internal], line ??

另外,当我启用调试并尝试在浏览器上注销以下错误时:

Fatal error: Call to a member function logout() on a non-object in /home/commstrat2_web/html/ticket/app/Controller/UsersController.php on line 117

当我关闭调试时,它只是出现空白屏幕,这仅在登录和注销时发生。

这听起来完全像是文件权限问题。仔细检查 app/tmp 文件夹以确保子目录的权限正确。