Rumah > pembangunan bahagian belakang > tutorial php > Zend Framework 配置有关问题

Zend Framework 配置有关问题

WBOY
Lepaskan: 2016-06-13 09:59:09
asal
938 orang telah melayarinya

Zend Framework 配置问题

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->error_reporting(E_ALL|E_STRICT); ini_set('display_errors', 1); date_default_timezone_set('Asia/Shanghai'); // 目录设置和类装载 set_include_path('.' . PATH_SEPARATOR . '../library/'   . PATH_SEPARATOR . '../application/models/'   . PATH_SEPARATOR . '../application/controllers/'    . PATH_SEPARATOR . '../application/views/'    . PATH_SEPARATOR . get_include_path()); include "Zend/Loader/Autoloader.php"; Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true); // 载入配置文件$config=new Zend_Config_Ini('../application/config.ini','general');$registry=Zend_Registry::getInstance();$registry->set('config',$config);//设置数据库$db=Zend_Db::factory($config->db);Zend_Db_Table::setDefaultAdapter($db);//设置控制器$frontController = Zend_Controller_Front::getInstance(); $frontController->setBaseUrl('F:/PHP/Source/BookSystem/BookSystem/html');$frontController->throwExceptions(true); $frontController->setControllerDirectory('../application/controllers');Zend_Layout::startMvc(array('layoutPath'=>'../application/layouts')); // run! $frontController->dispatch(); 
Salin selepas log masuk

上面的代码:始终提示错误:
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (Index.php)' in F:\PHP\Source\BookSystem\BookSystem\library\Zend\Controller\Dispatcher\Standard.php:248 Stack trace: #0 F:\PHP\Source\BookSystem\BookSystem\library\Zend\Controller\Front.php(955): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 F:\PHP\Source\BookSystem\BookSystem\html\index.php(28): Zend_Controller_Front->dispatch() #2 {main} thrown in F:\PHP\Source\BookSystem\BookSystem\library\Zend\Controller\Dispatcher\Standard.php on line 248

求各位大侠!

------解决方案--------------------
你这个配置太落后了。。

不知你的是什么版本的,如果是 1.10 以上的,可以去官网下载个 quily start 。直接通用了
Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan