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

发布于 2024-10-17 11:03:09 字数 3612 浏览 6 评论 0原文

我已经在两台运行 apache 的不同 Windows 机器上成功运行了我的网站(WAMPP 在服务器上,XAMPP 在我的本地 devbev 机器上)。我正在将网站传输到 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 = **********

Bootstrap

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 上不起作用?

I've run my site successfully on two different windows machines running apache (WAMPP on aserver, and XAMPP on my local devbev machine). I'm in the process of transferring the site to a Linux server, but keep getting the following error

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

I've narrowed it down to being something wrong with the folder/path, as if I try and call any of my custom helpers I get the same problem.

Here is my config file

[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 = **********

Bootstrap

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

Anyone have any ideas why these aren't doing the trick on linux?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ〆星空下的拥抱 2024-10-24 11:03:09

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

After much debugging, it turns out that the file name for helpers in Linux is case sensitive and so must begin with a capital letter

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文