Home > Backend Development > PHP Tutorial > Zend Framework 配置有关问题

Zend Framework 配置有关问题

WBOY
Release: 2016-06-13 13:44:35
Original
916 people have browsed it

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(); 

Copy after login

上面的代码:始终提示错误:
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 。直接通用了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template