title: PDO is not working with CakePHP installation
body: <p>I am configuring a cakePHP application, but the app doesn't seems to connect successfully to DB, I got the following error:</p>
  
  <pre><code>Cake is NOT able to connect to the database.
  
  Database connection "Mysql" is missing, or could not be created.
  </code></pre>
  
  <p>I renamed the <code>database.php.default</code> to <code>database.php</code> and here is the code:</p>
  
  <pre><code>class DATABASE_CONFIG {
  
      public $default = array(
          'datasource' =&gt; 'Database/Mysql',
          'persistent' =&gt; false,
          'host' =&gt; 'localhost:8889',
          'login' =&gt; 'root',
          'password' =&gt; 'root',
          'database' =&gt; 'cakephpdb',
          'prefix' =&gt; '',
          'encoding' =&gt; 'utf8',
      );
  }
  </code></pre>
  
  <p>Actually, I know CakePHP use PDO driver to connect to DB, so I tried to run a separate file just to test whether the PDO is true of false:</p>
  
  <pre><code>&lt;?php
  
  var_dump( extension_loaded('pdo_mysql') );
  
  ?&gt; 
  </code></pre>
  
  <p>And it's false:</p>
  
  <pre><code>bool(false) 
  </code></pre>
  
  <p>I tried to enable PDO in <code>php.ini</code> file:</p>
  
  <pre><code>extension=php_pdo_mysql.so
  </code></pre>
  
  <p>Restarted MAMP, but still the same error for cakePHP app. Am I missing something? how do you make sure PDO is enabled in your cases? Thanx in advance.</p>
  
  <p><strong><em>EDIT:</em></strong></p>
  
  <p>When running phpinfo(), the PDO_MySQL is not enabled:
  <img src="https://i.stack.imgur.com/hPmA8.png" alt="enter image description here"></p>
  
  <p>The php.ini path is the follwoing, according to phpinfo() output:</p>
  
  <pre><code>/Applications/MAMP/bin/php/php5.4.10/conf 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/lXsFh.png" alt="enter image description here"></p>
  
  <p>So I tried to edit the <code>php.ini</code> file at that path and here is the relevant settings:</p>
  
  <pre><code>    extension=imap.so
      extension=yaz.so
      extension=mcrypt.so
      extension=gettext.so
      extension=pgsql.so
      extension=pdo_pgsql.so
      extension=pdo_mysql.so
  
  pdo_mysql.default_socket=/tmp/mysql.sock
  
  mysql.default_socket = /tmp/mysql.sock
  </code></pre>
  
  <p>Also, I tried to test the DB connection in a php script:</p>
  
  <pre><code>try {
      $dbh = new PDO('mysql:host=localhost;dbname=db_name', 'localhost', 'root');
      echo '&lt;br /&gt; success';
  } catch (PDOException $e) {
      print "Error !: " . $e-&gt;getMessage() . "&lt;br/&gt;";
  
  
      die();
  }
  </code></pre>
  
  <p>And I gto always the following error:</p>
  
  <pre><code>Error !: could not find driver
  </code></pre>
  
  <p>So the <code>PDO_Mysql</code> driver is not loaded, and that's clear from the phpinfo() output. Out to fix that?</p>