我正在将ZF2应用程序迁移到ZF3。
首先我收到错误:
Fatal error: Uncaught Zend\ModuleManager\Listener\Exception\RuntimeException: Could not find a valid ServiceManager for RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 202
Zend\ModuleManager\Listener\Exception\RuntimeException: Could not find a valid ServiceManager for RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 202
将'Zend\Router'
添加到modules
中的application.config.php
数组解决了这个问题。但现在我又收到了另一个错误:
Fatal error: Uncaught Zend\ServiceManager\Exception\ServiceNotFoundException: A plugin by the name "Zend\Mvc\Router\Http\Segment" was not found in the plugin manager Zend\Router\RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php on line 131
Zend\ServiceManager\Exception\ServiceNotFoundException: A plugin by the name "Zend\Mvc\Router\Http\Segment" was not found in the plugin manager Zend\Router\RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php on line 131
可能导致此错误的原因以及如何解决此问题?
答案 0 :(得分:3)
由Zend\Mvc\Router
引起的问题已移至Zend\Router
,因此只需将Zend\Mvc\Router\Http\Segment
替换为Zend\Router\Http\Segment