CakePHP死了,而不是告诉我错误

时间:2013-09-09 18:02:38

标签: cakephp cakephp-2.0

我有CakePHP。但有时候,如果我犯了(通常是语法)错误,它并没有告诉我哪里出错,哪有出错,它只是死了而且我得到了:

sdf

为什么会这样,我怎样才能获得行号和错误类型?

调试已开启。版本2.2.3

UPDATE1:

    Configure::write('Error', array(
        'handler' => 'ErrorHandler::handleError',
        'level' => E_ALL & ~E_DEPRECATED & ~E_STRICT,
        'trace' => true
    ));
Configure::write('Exception', array(
    'handler' => 'ErrorHandler::handleException',
    'renderer' => 'ExceptionRenderer',
    'log' => true
));

错误文件:

enter image description here

更新2:

app/tmp/error.log在我chmod -R 777 app/tmp/log/后出现以下内容后,权限出现问题:

2013-09-13 08:17:32 Error: Fatal Error (4): parse error in    [/Users/petarpetrov/jobsAdvent/sunshine/app/View/Themed/Jobsearch/Users/employer_setting.ctp, line 24]
2013-09-13 08:17:32 Error: [FatalErrorException] parse error
#0 /Users/petarpetrov/jobsAdvent/sunshine/lib/Cake/Error/ErrorHandler.php(161):     ErrorHandler::handleFatalError(4, 'parse error', '/Users/petarpet...', 24)
#1 [internal function]: ErrorHandler::handleError(4, 'parse error', '/Users/petarpet...', 24, Array)
#2 /Users/petarpetrov/jobsAdvent/sunshine/lib/Cake/Core/App.php(926): call_user_func('ErrorHandler::h...', 4, 'parse error', '/Users/petarpet...', 24, Array)
#3 /Users/petarpetrov/jobsAdvent/sunshine/lib/Cake/Core/App.php(899): App::_checkFatalError()
#4 [internal function]: App::shutdown()

5 {main}

发生此类错误后,

/var/logs/apache2/error_log没有新行。但是,我有以下几点:

[Thu Sep 12 12:43:37 2013] [notice] caught SIGTERM, shutting down
[Thu Sep 12 12:44:08 2013] [warn] Init: Session Cache is not configured [hint:     SSLSessionCache]
httpd: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
PHP:  parse error in /private/etc/php.ini on line 1927
[Thu Sep 12 12:44:08 2013] [notice] Digest: generating secret for digest authentication ...
[Thu Sep 12 12:44:08 2013] [notice] Digest: done
[Thu Sep 12 12:44:08 2013] [notice] Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/0.9.8x configured -- resuming normal operations
[Thu Sep 12 12:53:55 2013] [notice] child pid 467 exit signal Segmentation fault (11)
[Thu Sep 12 12:53:55 2013] [notice] child pid 466 exit signal Segmentation fault (11)
[Thu Sep 12 13:02:14 2013] [notice] child pid 468 exit signal Segmentation fault (11)
[Thu Sep 12 13:02:33 2013] [notice] child pid 545 exit signal Segmentation fault (11)
[Thu Sep 12 16:21:26 2013] [notice] child pid 463 exit signal Segmentation fault (11)
[Thu Sep 12 16:21:28 2013] [notice] child pid 465 exit signal Segmentation fault (11)
[Fri Sep 13 10:14:50 2013] [notice] child pid 462 exit signal Segmentation fault (11)

网络标签:

enter image description here

1 个答案:

答案 0 :(得分:2)

  • 检查app / tmp / logs / error.log
  • 检查Web服务器错误并访问日志!
  • 检查chrome中的“网络”标签,然后检查响应并请求
  • 或使用Charles(http://www.charlesproxy.com/)之类的内容来监控请求和响应
  • 检查应用程序返回的标头