RuntimeException: Module could not be initialized in ModuleManager

When adding a new module manually in Zend 3 platform, you basically add files within a defined folder structure of your own (you can just copy a skeleton application and rename the directory). See the tutorial on Zend 3 project for more details.

Once you have added the files you will generally meet a few errors if you just hit the refresh button of your browser.

PHP Fatal error: Uncaught Zend\ModuleManager\Exception\RuntimeException: Module could not be initialized in … ModuleManager

So make sure you do the following steps

Inside the config directory of your project :


[ 'Zend\Router',
// Add the Doctrine integration modules. 
'MyModule' ]; 

And to make sure everything is running fine on the configuration side, add this at the root of your project inside composer.json file :

"autoload" : {

"autoload" :

{ "psr-4" :


"Application\\" : "module/Application/src/",

"MyModule\\" : "module/MyModule/src/"




Beware when using an IDE such as Eclipse or NetBeans or any others, when you change the composer.json file using the default editor, it might not overwrite the true file and you will end up with the Runtime Exception. So do modify your file content using a text editor :

Text Editor - composer json

Run composer update

One more last step and you will be done :

$ composer update


If you are having other issues, you should check the right paths which you have set up in your module.config.php file.

Stay tune for more typical Zf3 integration errors, we will add them here so we can keep track on them and have a quick fix when we encounter them again. For instance we will try to add this entry right inside our code in another project.


One response to “RuntimeException: Module could not be initialized in ModuleManager”

  1. Mohamed Abdul-Fattah says:

    Saved my day. Thanks.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Want more information?

Related links will be displayed within articles for you to pick up another good spot to get more details about software development, deployment & monitoring.

Stay tuned by following us on Youtube.

%d bloggers like this: