如何克服这些异常?

时间:2014-04-26 10:01:07

标签: php git zend-framework netbeans xampp

音乐商店部署在zend框架工作中,从git存储库部署后我得到了这些错误

这些错误太多了,我是一个框架菜鸟。请帮我 !!!

  

(!)致命错误:未捕获的异常        'Zend \ ModuleManager \ Exception \ RuntimeException',带有消息'Module        (申请)无法初始化。在        C:\ XAMPP \ htdocs中\ albumzend \供应商\ zendframework \ zendframework \图书馆\的Zend \ ModuleManager会\ ModuleManager.php        在第189行(!)Zend \ ModuleManager \ Exception \ RuntimeException:        模块(应用程序)无法初始化。在        C:\ XAMPP \ htdocs中\ albumzend \供应商\ zendframework \ zendframework \图书馆\的Zend \ ModuleManager会\ ModuleManager.php        在线189呼叫堆栈        #Time Memory Function Location 1 0.0010 135312 {main}().. \ index.php:0 2 0.0270 266752 Zend \ Mvc \ Application :: init(        ).. \ index.php:17        3 0.1630 1117408 Zend \ ModuleManager \ ModuleManager-> loadModules(        ).. \ Application.php:252        4 0.1630 1117592 Zend \ EventManager \ EventManager->触发器(        ).. \ ModuleManager.php:109        5 0.1630 1117776 Zend \ EventManager \ EventManager-> triggerListeners(        ).. \ EventManager.php:207 6 0.1670 1131560 call_user_func(        ).. \ EventManager.php:468        7 0.1670 1131576 Zend \ ModuleManager \ ModuleManager-> onLoadModules(        ).. \ EventManager.php:468        8 0.1670 1131912 Zend \ ModuleManager \ ModuleManager-> loadModule(        ).. \ ModuleManager.php:90        9 0.1670 1132064 Zend \ ModuleManager \ ModuleManager-> loadModuleByName(        ).. \ ModuleManager.php:163

我的APPLICATION.PHP

<?php
return array(
    // This should be an array of module namespaces used in the application.
    'modules' => array(
        'Application',
        'Musicstore',

    ),

    // These are various options for the listeners attached to the ModuleManager
    'module_listener_options' => array(
        // This should be an array of paths in which modules reside.
        // If a string key is provided, the listener will consider that a module
        // namespace, the value of that key the specific path to that module's
        // Module class.
        'module_paths' => array(
            './module',
            './vendor',
        ),

        // An array of paths from which to glob configuration files after
        // modules are loaded. These effectively override configuration
        // provided by modules themselves. Paths may use GLOB_BRACE notation.
        'config_glob_paths' => array(
            'config/autoload/{,*.}{global,local}.php',
        ),

        // Whether or not to enable a configuration cache.
        // If enabled, the merged configuration will be cached and used in
        // subsequent requests.
        //'config_cache_enabled' => $booleanValue,

        // The key used to create the configuration cache file name.
        //'config_cache_key' => $stringKey,

        // Whether or not to enable a module class map cache.
        // If enabled, creates a module class map cache which will be used
        // by in future requests, to reduce the autoloading process.
        //'module_map_cache_enabled' => $booleanValue,

        // The key used to create the class map cache file name.
        //'module_map_cache_key' => $stringKey,

        // The path in which to cache merged configuration.
        //'cache_dir' => $stringPath,

        // Whether or not to enable modules dependency checking.
        // Enabled by default, prevents usage of modules that depend on other modules
        // that weren't loaded.
        // 'check_dependencies' => true,
    ),

    // Used to create an own service manager. May contain one or more child arrays.
    //'service_listener_options' => array(
    //     array(
    //         'service_manager' => $stringServiceManagerName,
    //         'config_key'      => $stringConfigKey,
    //         'interface'       => $stringOptionalInterface,
    //         'method'          => $stringRequiredMethodName,
    //     ),
    // )

   // Initial configuration with which to seed the ServiceManager.
   // Should be compatible with Zend\ServiceManager\Config.
   // 'service_manager' => array(),
);

INDEX.PHP模块&gt; musicstore&gt; ablums&gt; index.php

<?php
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 1);
date_default_timezone_set('Asia/Kolkata');

// directory setup and class loading

set_include_path('.' . PATH_SEPARATOR . '/xampp/htdocs/albumzend/library/'
     . PATH_SEPARATOR . '/xampp/htdocs/albumzend/application/models/albums'
     . PATH_SEPARATOR . '/xampp/htdocs/albumzend/application/forms/albums'
     . PATH_SEPARATOR . get_include_path());

include "Zend/Loader/Autoloader.php";
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('Models');
$loader->setFallbackAutoloader(true);
$loader->suppressNotFoundWarnings(false);

$view = new Zend_View();
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

// load configuration
$config = new Zend_Config_Ini('/xampp/htdocs/albumzend/application/config.ini', 'general');
$registry = Zend_Registry::getInstance();
$registry->set('config', $config);

// setup database
$db = Zend_Db::factory($config->db);
Zend_Db_Table::setDefaultAdapter($db);
$registry->set('db', $db);

// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('/xampp/htdocs/albumzend/application/controllers');

Zend_Layout::startMvc(array('layoutPath'=>'/xampp/htdocs/albumzend/application/layouts'));

// run!
$frontController->dispatch();
?>

我的申请

module>musicstore>application>configs>Application.ini
[production]

phpSettings.display_startup_errors = 0

phpSettings.display_errors = 0

includePaths.library = APPLICATION_PATH "xampp/htdocs/albumzend/library"

bootstrap.path = APPLICATION_PATH "/Bootstrap.php"

bootstrap.class = "Bootstrap"

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

文件结构:

http://i58.tinypic.com/2uqcbpv.png

Git存储库:https://github.com/srish/Music-Store.git

1 个答案:

答案 0 :(得分:0)

在你的git我没有看到带有index.php文件的公共目录启动zend-framework应用程序,我看到你把它移到了albums / index.php但是又一次它不是自动项目生成器给出的文件zend-framework 1.12

我有一个想法给你。下载最新的ZF 1(现在是1.12,而不是2008年的1.8),然后再次尝试重新创建项目。它会更好地发挥作用,因为在性能甚至框架方面都有一些巨大的变化会产生巨大的积极影响。

PS:在启动ZF的index.php文件中 - 您不应进行任何更改。尝试在应用程序目录中的Bootstrap.php中创建它们。