0

我按照 ZfcUser 的安装说明进行操作。

composer.json 看起来像这样:

{
    "name": "zendframework/skeleton-application",
    "description": "Skeleton Application for ZF2",
    "license": "BSD-3-Clause",
    "keywords": [
        "framework",
        "zf2"
    ],
    "homepage": "http://framework.zend.com/",
    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": ">2.2.0rc1",
        "zendframework/zend-developer-tools": "dev-master",
        "zendframework/zftool": "dev-master",
    "zf-commons/zfc-user": "dev-master"
    }
}

然后我运行以下命令:

> php composer.phar self-update
> php compsoer.phar update

它将 ./zfc-base 和 ./zfc-user 安装到带有路径的 ./vendor/zf-commons 文件夹中。在 config/application.config.php 中,我将模块“ZfcBase”和“ZfcUser”都添加到了“modules”数组中。

毕竟,我收到错误 500。Apache 错误日志保持以下内容:

[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP Warning:  include(/var/www/html/zf2-test/vendor/zf-commons/zfc-base/Module.php): failed to open stream: Permission denied in /var/www/html/zf2-test/vendor/composer/ClassLoader.php on line 185
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP Stack trace:
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   1. {main}() /var/www/html/zf2-test/public/index.php:0
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   2. Zend\\Mvc\\Application::init() /var/www/html/zf2-test/public/index.php:13
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   3. Zend\\ModuleManager\\ModuleManager->loadModules() /var/www/html/zf2-test/vendor/ZF2/library/Zend/Mvc/Application.php:253
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   4. Zend\\EventManager\\EventManager->trigger() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:109
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   5. Zend\\EventManager\\EventManager->triggerListeners() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:207
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   6. call_user_func() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   7. Zend\\ModuleManager\\ModuleManager->onLoadModules() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   8. Zend\\ModuleManager\\ModuleManager->loadModule() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:90
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   9. Zend\\ModuleManager\\ModuleManager->loadModuleByName() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:149
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  10. Zend\\EventManager\\EventManager->trigger() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:171
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  11. Zend\\EventManager\\EventManager->triggerListeners() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:207
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  12. call_user_func() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  13. Zend\\ModuleManager\\Listener\\ModuleResolverListener->__invoke() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  14. class_exists() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php:28
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  15. spl_autoload_call() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php:28
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  16. Composer\\Autoload\\ClassLoader->loadClass() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php:0
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP Warning:  include(): Failed opening '/var/www/html/zf2-test/vendor/zf-commons/zfc-base/Module.php' for inclusion (include_path='.:/usr/bin/pear:/usr/bin/php') in /var/www/html/zf2-test/vendor/composer/ClassLoader.php on line 185
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP Stack trace:
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   1. {main}() /var/www/html/zf2-test/public/index.php:0
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   2. Zend\\Mvc\\Application::init() /var/www/html/zf2-test/public/index.php:13
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   3. Zend\\ModuleManager\\ModuleManager->loadModules() /var/www/html/zf2-test/vendor/ZF2/library/Zend/Mvc/Application.php:253
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   4. Zend\\EventManager\\EventManager->trigger() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:109
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   5. Zend\\EventManager\\EventManager->triggerListeners() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:207
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   6. call_user_func() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   7. Zend\\ModuleManager\\ModuleManager->onLoadModules() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   8. Zend\\ModuleManager\\ModuleManager->loadModule() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:90
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP   9. Zend\\ModuleManager\\ModuleManager->loadModuleByName() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:149
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  10. Zend\\EventManager\\EventManager->trigger() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:171
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  11. Zend\\EventManager\\EventManager->triggerListeners() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:207
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  12. call_user_func() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  13. Zend\\ModuleManager\\Listener\\ModuleResolverListener->__invoke() /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php:468
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  14. class_exists() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php:28
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  15. spl_autoload_call() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php:28
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP  16. Composer\\Autoload\\ClassLoader->loadClass() /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php:0
[Mon Jun 03 23:52:40 2013] [error] [client ::1] PHP Fatal error:  Uncaught exception 'Zend\\ModuleManager\\Exception\\RuntimeException' with message 'Module (ZfcBase) could not be initialized.' in /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php:175
Stack trace:
#0 /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php(149): Zend\\ModuleManager\\ModuleManager->loadModuleByName(Object(Zend\\ModuleManager\\ModuleEvent))
#1 /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php(90): Zend\\ModuleManager\\ModuleManager->loadModule('ZfcBase')
#2 [internal function]: Zend\\ModuleManager\\ModuleManager->onLoadModules(Object(Zend\\ModuleManager\\ModuleEvent))
#3 /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\\ModuleManager\\ModuleEvent))
#4 /var/www/html/zf2-test/vendor/ZF2/library/Zend/EventManager/EventManager.php(207): Zend\\EventManager\\EventManager->triggerListeners('loadModules', Object(Zend\\ModuleManager\\ModuleEvent), NULL)
#5 /var/www/ in /var/www/html/zf2-test/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php on line 175

我已将 ./vendor 文件夹的权限设置为 0755 -R,但仍然无法正常工作...我不断收到相同的错误...没有 ZfcUser 和 ZfcBase 应用程序可以正常工作...

4

1 回答 1

0

你添加了你的 application.config.php

        'module_paths' => array(
        './module',
        './vendor',
        './vendor/zf-commons',
    )
于 2013-06-04T12:14:09.060 回答