Please try with this: In Module.php. public function getServiceConfig() { return array( 'factories' => array( // some other service config setup, 'AuthService' => function($sm) { $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); .