当前位置:Gxlcms > PHP教程 > 在wamp5下配置zendframework有异常

在wamp5下配置zendframework有异常

时间:2021-07-01 10:21:17 帮助过:12人阅读

在wamp5下配置zend framework有错误!
我是看PHP100视频学习Zend framework,配置时出现了下面的错误,希望那位大虾指点下?
index.php

error_reporting(E_ALL|E_STRICT); //在开启错误报告

date_default_timezone_set('Asia/Shanghai'); //配置地区

set_include_path('.'.PATH_SEPARATOR.'./library.'.PATH_SEPARATOR.'./application/models/'.PATH_SEPARATOR.get_include_path());
//配置环境路径

require_once 'Zend/Loader/Autoloader.php'; //载入zend框架
Zend_loader_Autoloader::getInstance()->setFallbackAutoloader(true); //静态载入自动类文件

$registry = Zend_Registry::getInstance(); //静态获得实例
$view = new Zend_View(); //实例化zend模版
$view-> setScriptPath('./application/views/scripts/'); //设置模版显示路径
$registry['view'] = $view; //注册View

//设置控制器
$frontController = Zend_Controller_Front::getInstance();

$frontController -> setBaseUrl('/zendframework') //设置基本路径
-> setParam('noViewBenderer', true)
-> setControllerDirectory('./application/controllers')
-> throwExceptions(true) -> dispatch();
?>


错误提示:
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (index.php)' in F:\local_www\zendframework\library\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 F:\local_www\zendframework\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 F:\local_www\zendframework\index.php(24): Zend_Controller_Front->dispatch() #2 {main} thrown in F:\local_www\zendframework\library\Zend\Controller\Dispatcher\Standard.php on line 242

------解决方案--------------------
用Zend framework自带错误的调试方式,要不然它老抛出你说的一大堆错误,一开始我也被搞了几天,如期是调试sql时。

人气教程排行