0
votes

I have a problem based on the following question: Module cannot be initialized zf3 ...

As mentioned in this questiion, I did a dump-autoload with composer on the production-server and downloaded the project for working local on my computer.

When I load "http://localhost/myproject", everything is okay and I can access both Modules. When I load "http://production-server/myproject" (where I did the dump-autoload) nothing ist showed and I get

Uncaught Zend\ModuleManager\Exception\RuntimeException: Module (Blog) could not be initialized. in /srv/www/htdocs/zf3/vendor/zendframework/zend-modulemanager/src/ModuleManager.php:203

Stack trace:
#0 /srv/www/htdocs/zf3/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(175): Zend\ModuleManager\ModuleManager-> loadModuleByName(Object(Zend\ModuleManager\ModuleEvent))
#1 /srv/www/htdocs/zf3/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager->loadModule('Blog')
#2 /srv/www/htdocs/zf3/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\ModuleManager\ModuleManager->onLoadModules(Object(Zend\ModuleManager\ModuleEvent))
#3 /srv/www/htdocs/zf3/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#4 /srv/www/htdocs/zf3/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(120): Zend\EventManager\EventManager->triggerEvent(Object(Zen in /srv/www/htdocs/zf3/vendor/zendframework/zend-modulemanager/src/ModuleManager.php on line 203

It seems there is a difference between the two apache2-servers (both on PHP7).

Has anybody an idea what to search for?

1
Are your local server on windows and your production on Linux by any chance?Thomas Dutrion
@ThomasDutrion Exactly, locally I have a xampp installation and openSUSE on the productive Server.TheFan1968

1 Answers

0
votes

When composer makes a dump-autoload, it writes files into the project.

I have composer installed globally on the machine for using him with different projects.

It seems composer sets wrong rights on the files. I tried chmod 777 on the whole project to get a hint on solving this problem and now it works.

I set the autoload.php to 755 now and it still works.

The difference between the servers is the rights management and you have to change the right of autoload.php after creating it initially.