我刚刚将我的开发站点复制到实时服务器,使用新的数据库连接详细信息等更新了配置,但收到以下错误消息:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message `'Plugin by name 'IncludeStyles' was not found in the registry; used paths: Zend_View_Helper_Navigation_: Zend/View/Helper/Navigation/ Zend_View_Helper_: Zend/View/Helper/:./views/helpers/:/home/wheresrh/public_html/spz/application/views/helpers/' in /home/wheresrh/public_html/spz/library/Zend/Loader/PluginLoader.php:412 Stack trace: #0 /home/wheresrh/public_html/spz/library/Zend/View/Abstract.php(1173): Zend_Loader_PluginLoader->load('IncludeStyles') #1 /home/wheresrh/public_html/spz/library/Zend/View/Abstract.php(609): Zend_View_Abstract->_getPlugin('helper', 'includeStyles') #2 /home/wheresrh/public_html/spz/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('includeStyles') #3 [internal function]: Zend_View_Abstract->__call('includeStyles', Array) #4 /home/wheresrh/public_html/spz/application/layouts/layout.phtml(19): Zend_View->includeStyles('full') #5 /home/wheresrh/public_html/spz/library/Zend/View.php(108): include('/h in /home/wheresrh/public_html/spz/library/Zend/Loader/PluginLoader.php on line 412`
所以看起来自动加载器无法将视图/帮助器目录作为帮助器类的位置,即使在实时和开发站点上的文件夹结构和引导程序完全相同。
还有什么可能会影响自动加载器查找辅助类的能力?
这是我的application.ini:
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
autoloaderNamespaces[] = "SPZ_"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/"
resources.db.adapter = PDO_MySql
resources.db.params.host = localhost
resources.db.params.username = ******
resources.db.params.password = ******
resources.db.params.dbname = ******
还有我的引导程序
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAutoload()
{
$moduleLoader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH));
}
protected function _initViewHelpers()
{
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->doctype('XHTML1_STRICT');
$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('Sum Puzzles');
$view->addHelperPath(APPLICATION_PATH.'/views/helpers/');
}
}
这是我的 index.php
<?php
error_reporting(E_ALL | E_STRICT);
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
也许我的引导和配置文件中有一些冲突/冗余的行?
*编辑我现在正在尝试复制到不同的服务器并收到类似的错误,因为“视图”目录尚未设置为查找视图脚本的位置。