在wamp5下配置zend framework有错误!
本帖最后由 xiongdawang 于 2012-11-07 15:21:33 编辑
我是看PHP100视频学习Zend framework,配置时出现了下面的错误,希望那位大虾指点下?
index.php
<br />
<?php<br />
error_reporting(E_ALL|E_STRICT); //在开启错误报告<br />
<br />
date_default_timezone_set('Asia/Shanghai'); //配置地区<br />
<br />
set_include_path('.'.PATH_SEPARATOR.'./library.'.PATH_SEPARATOR.'./application/models/'.PATH_SEPARATOR.get_include_path());<br />
//配置环境路径<br />
<br />
require_once 'Zend/Loader/Autoloader.php'; //载入zend框架<br />
Zend_loader_Autoloader::getInstance()->setFallbackAutoloader(true); //静态载入自动类文件<br />
<br />
$registry = Zend_Registry::getInstance(); //静态获得实例<br />
$view = new Zend_View(); //实例化zend模版<br />
$view-> setScriptPath('./application/views/scripts/'); //设置模版显示路径<br />
$registry['view'] = $view; //注册View<br />
<br />
//设置控制器<br />
$frontController = Zend_Controller_Front::getInstance();<br />
<br />
$frontController -> setBaseUrl('/zendframework') //设置基本路径<br />
-> setParam('noViewBenderer', true)<br />
-> setControllerDirectory('./application/controllers')<br />
-> throwExceptions(true) -> dispatch();<br />
?><br />
로그인 후 복사
错误提示:
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时。