2016-12-23 3 views
1

Also folgte ich den Befehl zum Einrichten Zend Framework auf Mac OSX und ich erhalte diese Störung:Wo ist der Fehler bei der Einrichtung dieses Zend Framework?

Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (Application) could not be initialized.' in /Users/ldco2016/Projects/kbase/vendor/zendframework/zend-modulemanager/src/ModuleManager.php on line 203 
(!) Zend\ModuleManager\Exception\RuntimeException: Module (Application) could not be initialized. in /Users/ldco2016/Projects/kbase/vendor/zendframework/zend-modulemanager/src/ModuleManager.php on line 203 

ich ein paar ähnliche Beiträge gefolgt:

ZF2: Module could not be initialized

Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (Album) could not be initialized

Und sie scheinen nicht spezifisch zu meinem Problem zu sprechen.

Hier ist meine Dateistruktur:

[email protected] ~/Projects/kbase $ tree -d .                           [ruby-2.2.1] 
. 
├── config 
│   └── autoload 
├── data 
│   └── cache 
├── module 
│   ├── Application 
│   │   ├── config 
│   │   ├── src 
│   │   │   └── Controller 
│   │   ├── test 
│   │   │   └── Controller 
│   │   └── view 
│   │    ├── application 
│   │    │   └── index 
│   │    ├── error 
│   │    └── layout 
│   └── Article 
│    ├── config 
│    ├── src 
│    │   └── Article 
│    │    ├── Controller 
│    │    ├── Form 
│    │    └── Model 
│    └── views 
│     └── article 
│      └── article 
├── public 
│   ├── css 
│   ├── fonts 
│   ├── img 
│   └── js 
└── vendor 
    ├── bin 
    ├── composer 

KBase/module/Artikel/module.php:

<?php 
namespace Article; 

use Zend\ModuleManager\Feature\AutoloaderProviderInterface; 
use Zend\ModuleManager\Feature\ConfigProviderInterface; 

class Module implements AutoloaderProviderInterface, ConfigProviderInterface 
{ 
    public function getAutoloaderConfig() 
    { 
     return array(
      'Zend\Loader\ClassMapAutoloader' => array(
       __DIR__ . '/autoload_classmap.php', 
      ), 
      'Zend\Loader\StandardAutoloader' => array(
       'namespaces' => array(
        __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, 
       ), 
      ), 
     ); 
    } 

    public function getConfig() 
    { 
     return include __DIR__ . '/config/module.config.php'; 
    } 
} 

composer.json:

{ 
    "name": "zendframework/skeleton-application", 
    "description": "Skeleton Application for Zend Framework zend-mvc applications", 
    "type": "project", 
    "license": "BSD-3-Clause", 
    "keywords": [ 
     "framework", 
     "mvc", 
     "zf" 
    ], 
    "homepage": "http://framework.zend.com/", 
    "minimum-stability": "dev", 
    "prefer-stable": true, 
    "require": { 
     "php": "^5.6 || ^7.0", 
     "zendframework/zend-component-installer": "^1.0 || ^0.3 || ^[email protected]", 
     "zendframework/zend-mvc": "^3.0.1", 
     "zfcampus/zf-development-mode": "^3.0" 
    }, 
    "autoload": { 
     "psr-4": { 
      "Application\\": "module/Application/src/" 
     } 
    }, 
    "autoload-dev": { 
     "psr-4": { 
      "ApplicationTest\\": "module/Application/test/" 
     } 
    }, 
    "extra": [], 
    "scripts": { 
     "cs-check": "phpcs", 
     "cs-fix": "phpcbf", 
     "development-disable": "zf-development-mode disable", 
     "development-enable": "zf-development-mode enable", 
     "development-status": "zf-development-mode status", 
     "post-create-project-cmd": [ 
      "@development-enable" 
     ], 
     "serve": "php -S 0.0.0.0:8080 -t public/ public/index.php", 
     "test": "phpunit" 
    }, 
    "autoload": { 
    "psr-0": { "Article": "module/Article/src/" } 
    } 
} 

KBase/config/modules .config.php:

<?php 
/** 
* @link  http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository 
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com) 
* @license http://framework.zend.com/license/new-bsd New BSD License 
*/ 

/** 
* List of enabled modules for this application. 
* 
* This should be an array of module namespaces used in the application. 
*/ 
return [ 
    'Zend\Router', 
    'Zend\Validator', 
    'Application', 
    'Article' 
]; 

KBase/module/Artikel/autoload.classmap.php:

<?php 

return array(); 

Dies ist die Version von PHP ist, die ich habe:

[email protected] ~/Projects/kbase $ php -v                                           [ruby-2.2.5] 
PHP 5.6.29 (cli) (built: Dec 8 2016 23:03:30) 
Copyright (c) 1997-2016 The PHP Group 
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies 
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies 
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans 

Antwort

1

Es scheint mir, dass es entweder eine beschädigte Dateien oder Ihre PHP-Version ist weniger als 5.5-Version. Aktuelle Zf2-Version funktioniert auf php5 5+. Wenn Ihre PHP-Version gut ist, versuchen Sie es bitte erneut mit dem unten genannten Link.

https://framework.zend.com/manual/2.4/en/user-guide/skeleton-application.html

Lassen Sie mich wissen, wenn Sie noch Fragen konfrontiert sind.

+0

Ich werde Sie wissen lassen. Danke für das Antworten. – Daniel

+0

Es sieht so aus, als hätten Sie mich in Richtung der Verwendung meines lokalen Servers mit MAMP im Gegensatz zu Zend Server gezeigt. Ich werde deine Antwort als richtig markieren und mich auf diese Weise vorwärts bewegen. Vielen Dank für Ihre Zeit. – Daniel

+0

Ich bin froh, dass ich dir hier geholfen habe :). –

Verwandte Themen