douke6881 2014-04-26 10:01
浏览 66

如何克服这些异常?

Music store Deployed on zend frame work , after deploying from git repository I get these errors

These errors are way too many and i am a noob with frameworks . please help me !!!

( ! ) Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (Application) could not be initialized.' in C:\xampp\htdocs\albumzend\vendor\zendframework\zendframework\library\Zend\ModuleManager\ModuleManager.php on line 189 ( ! ) Zend\ModuleManager\Exception\RuntimeException: Module (Application) could not be initialized. in C:\xampp\htdocs\albumzend\vendor\zendframework\zendframework\library\Zend\ModuleManager\ModuleManager.php on line 189 Call Stack # 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->trigger( ) ..\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

MY 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 module>musicstore>ablums>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();
?>

MY APPLICATION

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"

File Struct:

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

Git Repository : https://github.com/srish/Music-Store.git

  • 写回答

1条回答 默认 最新

  • doujunchi1238 2014-04-26 11:50
    关注

    In your git i dont see public directory with index.php file that initiates the zend-framework application, i see you mover it to the albums/index.php but there once more its not the file given by automatic project generator for zend-framework 1.12

    I have one idea for you. Download the newest ZF 1 (now its 1.12, not 1.8 from 2008 year) and then try recreating your project once more. It will work better as there were several huge changes in performance and even framework that have huge positive impact.

    PS: in the index.php file that initiates the ZF - you should not make any changes. Try to make them in Bootstrap.php in application directory.

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?