PHP zend framework 找不到controller的错误

刚开始接触zend framework ,新建了一个controller,名字是NewsController.php,可以在运行时,却报错,错误信息如下:

Fatal error: Uncaught exception ‘Zend_Controller_Dispatcher_Exception’ with message ‘Invalid controller specified (news)’ in E:\RWAPM\www\library\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 E:\RWAPM\www\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 E:\RWAPM\www\kxl\index.php(26): Zend_Controller_Front->dispatch() #2 {main} thrown inE:\RWAPM\www\library\Zend\Controller\Dispatcher\Standard.php on line 242

经过确认,应该是找不到Controller才报的错,但是NewsController确实存在呀,仔细一看才发现,文件名保存出错了,NewsController.php在NewsController后面多了一个空格,导致无法加载文件,文件改名后,问题解决。

赶紧记下来,如果有人遇到同样的问题,好有一个借鉴。

http://kxl361.blog.163.com/blog/static/342955320105139451861/

 » 本站地址:http://www.gomoth.com

标签: