Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zf2 Module (DoctrineModule) could not be initialized

Hi i'm trying to install doctrine2 to zf2 via composer. I'm getting error: Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (DoctrineModule) could not be initialized.' I followed this steps https://github.com/doctrine/DoctrineORMModule

my application.config looks like this:

return array(
'modules' => array(
    'Application',
    'DoctrineModule',
    'DoctrineORMModule',
    'Album',
    'User'
),
'module_listener_options' => array(
    'config_glob_paths'    => array(
        'config/autoload/{,*.}{global,local}.php',
    ),
    'module_paths' => array(
        './module',
        './vendor',
    ),
),
);

My composer.json:

"minimum-stability": "dev",
"require": {
    "php": ">=5.3.3",
    "zendframework/zendframework": "2.*",
    "doctrine/doctrine-orm-module": "dev-master",
    "zendframework/zend-developer-tools": "*",
    "bjyoungblood/bjy-profiler": "*"
},

All needed doctrine librarys are in vendor/doctrine directory. I guess it's something wrong with autoloading.
After composer update i get message: [ErrorException] proc_open(): CreateProcess failed, error code - 267 i can't tell wath it means, but maybe this will be helpfull.

Second thing is that on https://github.com/doctrine/DoctrineORMModule there is section: Installation steps (without composer) and point 3. setup PSR-0 autoloading for namespace DoctrineORMModule ...where can I setup this thing ?

like image 571
user1838937 Avatar asked Nov 20 '12 14:11

user1838937


2 Answers

If some of vendor folders was created on another machine, this can lead to the error you got. So perform the following.

  1. Try to remove composer.lock and ./vendor folder.
  2. Then php composer.phar self-update
  3. Run php composer.phar install to re-install dependencies.
like image 118
shukshin.ivan Avatar answered Nov 18 '22 02:11

shukshin.ivan


As of https://github.com/composer/composer/issues/1063 and https://github.com/composer/composer/issues/1346 this looks like a problem with the setup of PHP under your environment (which I assume is windows).

The modules weren't installed correctly and composer did not dump the autoloader correctly because it crashed during the installation process.

Try repeating the installation process in a different path and check that you're using the latest version of composer with php composer.phar self-update

like image 40
Ocramius Avatar answered Nov 18 '22 01:11

Ocramius