Open userator opened 8 years ago
Same problem here using mac os 10.12.1:
PHP Fatal error: Uncaught Zend\ModuleManager\Listener\Exception\RuntimeException: Could not find a valid ServiceManager for RoutePluginManager in phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php:2
Stack trace:
#0 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-eventmanager/src/EventManager.php(2): Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#1 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-eventmanager/src/EventManager.php(2): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#2 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(2): Zend\EventManager\EventManager->triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#3 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-mvc/src/Application.php(2): Zend\ModuleManager\ModuleManager->loadModules()
#4 phar:///usr/local/bin/zftool.phar/zf.php(2): Zend in phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 2
Fatal error: Uncaught Zend\ModuleManager\Listener\Exception\RuntimeException: Could not find a valid ServiceManager for RoutePluginManager in phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php:2
Stack trace:
#0 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-eventmanager/src/EventManager.php(2): Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#1 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-eventmanager/src/EventManager.php(2): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#2 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(2): Zend\EventManager\EventManager->triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#3 phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-mvc/src/Application.php(2): Zend\ModuleManager\ModuleManager->loadModules()
#4 phar:///usr/local/bin/zftool.phar/zf.php(2): Zend in phar:///usr/local/bin/zftool.phar/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 2
When I use the zftools in a ZEND skeleton (https://github.com/zendframework/ZendSkeletonApplication) it prints out some HTML
Old issue I solved recently. It is caused by choosing too liberal way of composer's dependency versioning. There were too many >=
showing lack of experience on dependency management subject. If anythig would break, it will break with MAJOR. Selecting >= 2.2.2
as lower number boundary (that implicates there is no upper limit for version) causes some serious issues if anyone chnages their API upgrading MAJOR to let others know, that there are some major changes ( some of them might be not backward-compatible ).
TL; DR - just remove >=
signs from ZFTools composer.json, remove vendor directory and perform composer update
(and you might want to perform composer install
as well) and bin/create-phar
.
In your app consider as well some changes might break your app.
That fix is simple and imperfect - best choice would be for authors to change dependencies to most recent and yet compatible versions of zend-mvc and other components.
My bad. That actually wasn't the whole truth. It seems composer.json is lacking entry for zendframework or one of it's dependencies.
Short and pretty bad fix is to add zendframework as depedency. But then zftool.phar becomes 8MB file and generating it takes a while.
We have to inspect it and search for real problem.