开发者

Unable to access Zend_View_Helpers when transferring from WAMPP to Linux server

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"
r开发者_如何学运维esources.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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜