我刚刚部署了CakePHP应用程序的基本版本。这里没什么特别的或花哨的。只是一个基本授权模块和几个烘焙控制器。 但是,当我尝试打开网站时,会出现“未找到”错误。以下是错误日志显示的内容:
2015-04-13 21:14:07 Error: [Cake\Network\Exception\NotFoundException] Not Found
Request URL: /
Stack Trace:
#0 /home/public_html/site.com.au/vendor/cakephp/cakephp/src/View/View.php(815): include()
#1 /home/public_html/site.com.au/vendor/cakephp/cakephp/src/View/View.php(775): Cake\View\View->_evaluate('/home/pub...', Array)
#2 /home/public_html/site.com.au/vendor/cakephp/cakephp/src/View/View.php(463): Cake\View\View->_render('/home/pub...')
#3 /home/public_html/site.com.au/vendor/cakephp/cakephp/src/Controller/Controller.php(575): Cake\View\View->render('home', NULL)
#4 /home/public_html/site.com.au/src/Controller/PagesController.php(57): Cake\Controller\Controller->render('home')
#5 [internal function]: App\Controller\PagesController->display('home')
#6 /home/public_html/site.com.au/vendor/cakephp/cakephp/src/Controller/Controller.php(404): call_user_func_array(Array, Array)
#7 /home/public_html/site.com.au/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(114): Cake\Controller\Controller->invokeAction()
#8 /home/public_html/site.com.au/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(87): Cake\Routing\Dispatcher->_invoke(Object(App\Controller\PagesController))
#9 /home/public_html/site.com.au/webroot/index.php(37): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#10 {main}
任何线索? mod_rewrite已启用。登录页面正在运行但不是主页。 我的AppController有这个过滤器:
public function beforeFilter(Event $event)
{
$this->Auth->allow(array('controller' => 'pages', 'action' => 'display'));
}
谢谢!
更新
在cakephp 3.0中,这是需要从home.ctp文件中删除的代码
if (!Configure::read('debug')):
throw new NotFoundException();
endif;