1
votes

i'm using zend framework 3 with doctrine 2 and it giving me this error i dnt know why

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Unable to resolve service "Router" to a factory; are you certain you provided it during configuration?' in C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php:681 Stack trace: #0 C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(757): Zend\ServiceManager\ServiceManager->getFactory('Router') #1 C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate('Router') #2 C:\xampp\htdocs\zendf\vendor\zendframework\zend-mvc\src\Application.php(158): Zend\ServiceManager\ServiceManager->get('Router') #3 C:\xampp\htdocs\zendf\vendor\zendframework\zend-mvc\src\Application.php(273): Zend\Mvc\Application->bootstrap(Array) #4 C:\xampp\htdocs\zendf\public\index.php(40): Zend\Mvc\Application::init(Array) #5 {main} thrown in C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php on line 681

1
Please paste your module.config.php hereDolly Aswin

1 Answers

6
votes

I got the same problem while upgrading an app from zf2 to zf3.

I solved the problem by loading the module Zend\Router. There are some more modules coming with ZF3, so I ended up using this in the modules.config.php:

return [
    'Zend\Cache',
    'Zend\Form',
    'Zend\Hydrator',
    'Zend\InputFilter',
    'Zend\Paginator',
    'Zend\I18n',
    'Zend\Filter',
    'Zend\Router',
    'Zend\Validator',
    'Zend\Navigation',
    ...
];

I got the modules.config.php and the new application.config.php from the zf3 skeleton application.