title: Unable to resolve service "Zend\Db\Adapter\AdapterInterface" to a factory
body: <p>I am a newbie to zf.I downloaded the album project from github and started working on it . I did all the configuration as been written in the tutorial . 
  But i am getting this error continuously . 
  <code>Unable to resolve service "Zend\Db\Adapter\AdapterInterface" to a factory; are you certain you provided it during configuration?</code></p>
  
  <p>I started looking for some solutions and found same issue posted in Stack Overflow and went through them but none of the solution worked for me . Below i am pasting the pages code , pls assist i am stuck here for 2 days now. I am working on my local system . I have windows 10 and xampp installed. </p>
  
  <p>Module.php</p>
  
  <pre><code>&lt;?php
  namespace Album;
  
  use Zend\Db\Adapter\Adapter;
  use Zend\Db\Adapter\AdapterInterface;
  use Zend\Db\ResultSet\ResultSet;
  use Zend\Db\TableGateway\TableGateway;
  use Zend\ModuleManager\Feature\ConfigProviderInterface;
  
  class Module implements ConfigProviderInterface
  {
      public function getConfig()
      {
          echo "Module.php";
          return include __DIR__ . '/config/module.config.php';
      }
  
      public function getServiceConfig()
      {
          return [
              'factories' =&gt; [
                  Model\AlbumTable::class =&gt; function ($container) {
                      $tableGateway = $container-&gt;get('Model\AlbumTableGateway');
                      return new Model\AlbumTable($tableGateway);
                  },
                  'Model\AlbumTableGateway' =&gt; function ($container) {
                      $dbAdapter          = $container-&gt;get(AdapterInterface::class);
                      $resultSetPrototype = new ResultSet();
                      $resultSetPrototype-&gt;setArrayObjectPrototype(new Model\Album());
                      return new TableGateway('album', $dbAdapter, null, $resultSetPrototype);
                  },
              ],
          ];
      }
  
      public function getControllerConfig()
      {
          return [
              'factories' =&gt; [
                  Controller\AlbumController::class =&gt; function ($container) {
                      return new Controller\AlbumController(
                          $container-&gt;get(Model\AlbumTable::class)
                      );
                  },
              ],
          ];
      }
  }
  </code></pre>
  
  <p>module.config.php
      
  
  <pre><code>namespace Album;
  use Zend\Router\Http\Segment;
  
  return [
      'router' =&gt; [
          'routes' =&gt; [
              'album' =&gt; [
                  'type'    =&gt; Segment::class,
                  'options' =&gt; [
                      'route'       =&gt; '/album[/:action[/:id]]',
                      'constraints' =&gt; [
                          'action' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                          'id'     =&gt; '[0-9]+',
                      ],
                      'defaults'    =&gt; [
                          'controller' =&gt; Controller\AlbumController::class,
                          'action'     =&gt; 'index',
                      ],
                  ],
              ],
          ],
      ],
  
      'view_manager' =&gt; [
          'template_path_stack' =&gt; [
              'album' =&gt; __DIR__ . '/../view',
          ],
      ],
  ];
  </code></pre>
  
  <p>composer.json</p>
  
  <pre><code>{
  "name": "zendframework/skeleton-application",
  "description": "Skeleton Application for Zend Framework zend-mvc applications",
  "type": "project",
  "license": "BSD-3-Clause",
  "keywords": [
      "framework",
      "mvc",
      "zf"
  ],
  "homepage": "http://framework.zend.com/",
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
      "php": "^5.6 || ^7.0",
      "zendframework/zend-component-installer": "^1.0 || ^0.7 || ^1.0.0-dev@dev",
      "zendframework/zend-mvc": "^3.0.1",
      "zfcampus/zf-development-mode": "^3.0"
  },
  "autoload": {
      "psr-4": {
          "Application\\": "module/Application/src/",
          "Album\\": "module/Album/src/"
      }
  },
  "autoload-dev": {
      "psr-4": {
          "ApplicationTest\\": "module/Application/test/",
          "Album\\": "module/Album/src/"
      }
  },
  "extra": [],
  "scripts": {
      "cs-check": "phpcs",
      "cs-fix": "phpcbf",
      "development-disable": "zf-development-mode disable",
      "development-enable": "zf-development-mode enable",
      "development-status": "zf-development-mode status",
      "post-create-project-cmd": [
          "@development-enable"
      ],
      "serve": "php -S 0.0.0.0:8080 -t public public/index.php",
      "test": "phpunit"
  }
  }
  </code></pre>
  
  <p>global.php</p>
  
  <pre><code>return array(
   'db' =&gt; array(
      'driver'   =&gt; 'Pdo',
      'adapters' =&gt; array(
          'default_db' =&gt; array(
              'driver'         =&gt; 'Pdo',
              'dsn'            =&gt; 'mysql:dbname=zf2tutorial;host=localhost',
              'username' =&gt; 'root',
              'password' =&gt; '',
              'driver_options' =&gt; array(
                  PDO::MYSQL_ATTR_INIT_COMMAND =&gt; 'SET NAMES \'UTF8\'' // optional
              ),
          ),
      ),
  ),
  );
  </code></pre>
  
  <p>AlbumController.php</p>
  
  <pre><code>&lt;?php
  namespace Album\Controller;
  
  use Album\Form\AlbumForm;
  use Album\Model\Album;
  use Album\Model\AlbumTable;
  use Zend\Mvc\Controller\AbstractActionController;
  use Zend\View\Model\ViewModel;
  
  
  class AlbumController extends AbstractActionController
   {
   private $table;
  
  public function __construct(AlbumTable $table)
  {
      $this-&gt;table = $table;
  }
  
  public function indexAction()
  {
      // Grab the paginator from the AlbumTable:
      $paginator = $this-&gt;table-&gt;fetchAll(true);
  
      // Set the current page to what has been passed in query string,
      // or to 1 if none is set, or the page is invalid:
      $page = (int) $this-&gt;params()-&gt;fromQuery('page', 1);
      $page = ($page &lt; 1) ? 1 : $page;
      $paginator-&gt;setCurrentPageNumber($page);
  
      // Set the number of items per page to 10:
      $paginator-&gt;setItemCountPerPage(10);
  
      return new ViewModel(['paginator' =&gt; $paginator]);
  }
  
  public function addAction()
  {
      $form = new AlbumForm();
      $form-&gt;get('submit')-&gt;setValue('Add');
  
      $request = $this-&gt;getRequest();
  
      if (!$request-&gt;isPost()) {
          return ['form' =&gt; $form];
      }
  
      $album = new Album();
      $form-&gt;setInputFilter($album-&gt;getInputFilter());
      $form-&gt;setData($request-&gt;getPost());
  
      if (!$form-&gt;isValid()) {
          return ['form' =&gt; $form];
      }
  
      $album-&gt;exchangeArray($form-&gt;getData());
      $this-&gt;table-&gt;saveAlbum($album);
  
      return $this-&gt;redirect()-&gt;toRoute('album');
  }
  
  public function editAction()
  {
      $id = (int) $this-&gt;params()-&gt;fromRoute('id', 0);
  
      if (0 === $id) {
          return $this-&gt;redirect()-&gt;toRoute('album', ['action' =&gt; 'add']);
      }
  
      // Retrieve the album with the specified id. Doing so raises
      // an exception if the album is not found, which should result
      // in redirecting to the landing page.
      try {
          $album = $this-&gt;table-&gt;getAlbum($id);
      } catch (\Exception $e) {
          return $this-&gt;redirect()-&gt;toRoute('album', ['action' =&gt; 'index']);
      }
  
      $form = new AlbumForm();
      $form-&gt;bind($album);
      $form-&gt;get('submit')-&gt;setAttribute('value', 'Edit');
  
      $request  = $this-&gt;getRequest();
      $viewData = ['id' =&gt; $id, 'form' =&gt; $form];
  
      if (!$request-&gt;isPost()) {
          return $viewData;
      }
  
      $form-&gt;setInputFilter($album-&gt;getInputFilter());
      $form-&gt;setData($request-&gt;getPost());
  
      if (!$form-&gt;isValid()) {
          return $viewData;
      }
  
      $this-&gt;table-&gt;saveAlbum($album);
  
      // Redirect to album list
      return $this-&gt;redirect()-&gt;toRoute('album', ['action' =&gt; 'index']);
  }
  
  public function deleteAction()
  {
      $id = (int) $this-&gt;params()-&gt;fromRoute('id', 0);
      if (!$id) {
          return $this-&gt;redirect()-&gt;toRoute('album');
      }
  
      $request = $this-&gt;getRequest();
      if ($request-&gt;isPost()) {
          $del = $request-&gt;getPost('del', 'No');
  
          if ($del == 'Yes') {
              $id = (int) $request-&gt;getPost('id');
              $this-&gt;table-&gt;deleteAlbum($id);
          }
  
          // Redirect to list of albums
          return $this-&gt;redirect()-&gt;toRoute('album');
      }
  
      return [
          'id'    =&gt; $id,
          'album' =&gt; $this-&gt;table-&gt;getAlbum($id),
      ];
  }
  }
  </code></pre>