错误日志中的CakePHP空错误

时间:2015-02-02 13:41:18

标签: cakephp error-log

我们有一个网站,每次进入主页时,都会在错误日志中记录一个空错误。

2015-01-26 14:52:27 Error: [NotFoundException] Not Found
Request URL: /
Stack Trace:
#0 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/View/View.php(948): include()
#1 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/View/View.php(910): View->_evaluate('/var/www/vhosts...', Array)
#2 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/View/View.php(471): View->_render('/var/www/vhosts...')
#3 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Controller/Controller.php(954): View->render('home', NULL)
#4 /var/www/vhosts/.nl/subdomains//httpdocs/app/Controller/PagesController.php(41): Controller->render('home')
#5 [internal function]: PagesController->display('home')
#6 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Controller/Controller.php(490): ReflectionMethod->invokeArgs(Object(PagesController), Array)
#7 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Routing/Dispatcher.php(191): Controller->invokeAction(Object(CakeRequest))
#8 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Routing/Dispatcher.php(165): Dispatcher->_invoke(Object(PagesController), Object(CakeRequest))
#9 /var/www/vhosts/.nl/subdomains//httpdocs/app/webroot/index.php(108): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#10 {main}

我不知道导致此错误的原因。我尝试删除整个文件,所以你只看到一个空白页面,但然后错误仍然记录。有人能指出我正确的方向吗?

编辑回答一些问题: 我们有两种布局。一个普通的default.ctp和一个home.ctp,主页只有layout / home.ctp,没有pages / home.ctp。

1 个答案:

答案 0 :(得分:0)

事实证明我的项目错过了“Views / Pages / home.ctp”文件。该网站有两个布局,home.ctp和default.ctp(其余页面)。因为我们在“Views / Pages / home.ctp”中没有任何内容,所以删除了该文件,但由于这个原因我们得到了错误。当我们放回文件时(其中没有任何内容),错误就消失了。

如果您想了解更多问题,请查看提供的链接 ndm ,解决了我的问题!