Php 从WAMPP传输到Linux服务器时无法访问Zend_View_帮助程序
我已经在两台运行apache的不同windows机器上成功地运行了我的站点(在服务器上运行WAMPP,在本地devbev机器上运行XAMPP)。我正在将该站点传输到Linux服务器,但不断出现以下错误Php 从WAMPP传输到Linux服务器时无法访问Zend_View_帮助程序,php,linux,zend-framework,path,helpers,Php,Linux,Zend Framework,Path,Helpers,我已经在两台运行apache的不同windows机器上成功地运行了我的站点(在服务器上运行WAMPP,在本地devbev机器上运行XAMPP)。我正在将该站点传输到Linux服务器,但不断出现以下错误 Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'HeadIncludes' was not found in the registry; used
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'HeadIncludes' 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/sumpuzz1/public_html/test/application/views/helpers/' in /home/sumpuzz1/public_html/test/library/Zend/Loader/PluginLoader.php:412 Stack trace: #0 /home/sumpuzz1/public_html/test/library/Zend/View/Abstract.php(1174): Zend_Loader_PluginLoader->load('HeadIncludes') #1 /home/sumpuzz1/public_html/test/library/Zend/View/Abstract.php(610): Zend_View_Abstract->_getPlugin('helper', 'headIncludes') #2 /home/sumpuzz1/public_html/test/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('headIncludes') #3 /home/sumpuzz1/public_html/test/application/layouts/layout.phtml(23): Zend_View_Abstract->__call('headIncludes', Array) #4 /home/sumpuzz1/public_html/test/application/layouts/layout.phtml(23): Zend_View->headIncludes('css', 'full') #5 /home/sumpuzz1 in /home/sumpuzz1/public_html/test/library/Zend/Loader/PluginLoader.php on line 412
我已经把它缩小到文件夹/路径有问题,好像我试图打电话给我的任何自定义助手,我也会遇到同样的问题
这是我的配置文件
[testing]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
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.dbname = ***********
resources.db.params.username = *************
resources.db.params.password = **********
引导
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
define('APPLICATION_ENV', 'testing');
// 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();
经过大量调试后,发现Linux中帮助程序的文件名区分大小写,因此必须以大写字母开头。如果您使用Mac OS X,也会发生同样的情况。默认情况下,文件系统不区分大小写。此外,当涉及zend类名时,linux似乎更区分大小写——我不小心在一个地方输入了zend_JSON而不是zend_JSON,这在linux上是不区分大小写的,但Windows文件名不区分大小写。您可以将文件命名为Json.php和Json.php,并将它们放在Linux中的一个目录中。但不在windows上;)