gpt4 book ai didi

php - 从 WAMPP 传输到 Linux 服务器时无法访问 Zend_View_Helpers

转载 作者:太空宇宙 更新时间:2023-11-04 11:39:20 25 4
gpt4 key购买 nike

我已经在两台运行 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 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/');
}

}

索引.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 上不起作用吗?

最佳答案

经过多次调试,Linux 中helpers 的文件名是区分大小写的,因此必须以大写字母开头

关于php - 从 WAMPP 传输到 Linux 服务器时无法访问 Zend_View_Helpers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5009422/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com