title: PHP PDO "could not find driver" error with php 5.5.21 / Apache 2.4 / MySQL 5.6.22 in windows
body: <p>I have simple .php file with PDO</p>
  
  <pre><code>&lt;?php
  // DB connection info
  $host = "localhost";
  $user = "root";
  $pwd = "1234";
  $db = "registration";
  try{
      $conn = new PDO( "mysql:host=$host;dbname=$db", $user, $pwd);
      $conn-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
      $sql = "CREATE TABLE registration_tbl(
                  id INT NOT NULL AUTO_INCREMENT,
                  PRIMARY KEY(id),
                  name VARCHAR(30),
                  email VARCHAR(30),
                  date DATE)";
      $conn-&gt;query($sql);
  }
  catch(Exception $e){
      die(print_r($e));
  }
  echo "&lt;h3&gt;Table created.&lt;/h3&gt;";
  ?&gt;
  </code></pre>
  
  <p>and When I execute this php file, I can see this error message.</p>
  
  <pre><code>PDOException Object ( [message:protected] =&gt; could not find driver [string:Exception:private] =&gt; [code:protected] =&gt; 0 [file:protected] =&gt; C:\Apache24\htdocs\registration\createtable.php [line:protected] =&gt; 8 [trace:Exception:private] =&gt; Array ( [0] =&gt; Array ( [file] =&gt; C:\Apache24\htdocs\registration\createtable.php [line] =&gt; 8 [function] =&gt; __construct [class] =&gt; PDO [type] =&gt; -&gt; [args] =&gt; Array ( [0] =&gt; mysql:host=localhost;dbname=registration [1] =&gt; root [2] =&gt; 1234 ) ) ) [previous:Exception:private] =&gt; [errorInfo] =&gt; ) 1
  </code></pre>
  
  <p>So I have uncommented and set 'php.ini' file according to other question &amp; answer about similar problem.</p>
  
  <pre><code>extension=php_pdo_mysql.dll
  extension_dir = "c:/php/ext" (absolute Path)
  </code></pre>
  
  <p>but, there was no particular change in the situation. Still could not find drivers.</p>
  
  <p>However, When I type 'php -m' and 'php -i', I can find PDO is enable.</p>
  
  <p>php -m</p>
  
  <pre><code>[PHP Modules]
  bcmath
  calendar
  Core
  ctype
  date
  dom
  ereg
  filter
  ftp
  hash
  iconv
  json
  libxml
  mcrypt
  mhash
  mysqlnd
  odbc
  pcre
  PDO
  pdo_mysql
  Phar
  Reflection
  session
  SimpleXML
  SPL
  standard
  tokenizer
  wddx
  xml
  xmlreader
  xmlwriter
  zip
  zlib
  </code></pre>
  
  <p>php -i</p>
  
  <pre><code>pcre.backtrack_limit =&gt; 1000000 =&gt; 1000000
  pcre.recursion_limit =&gt; 100000 =&gt; 100000
  
  PDO
  
  PDO support =&gt; enabled
  PDO drivers =&gt; mysql
  
  pdo_mysql
  
  PDO Driver for MySQL =&gt; enabled
  Client API version =&gt; mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb10
  57292d73b928b8c5c77 $
  
  Phar
  
  Phar: PHP Archive support =&gt; enabled
  Phar EXT version =&gt; 2.0.2
  Phar API version =&gt; 1.1.1
  SVN revision =&gt; $Id: cc0fad28eb9ea42466f756c3b5fc22c764e32690 $
  Phar-based phar archives =&gt; enabled
  Tar-based phar archives =&gt; enabled
  ZIP-based phar archives =&gt; enabled
  gzip compression =&gt; enabled
  bzip2 compression =&gt; disabled (install pecl/bz2)
  OpenSSL support =&gt; disabled (install ext/openssl)
  </code></pre>
  
  <p>Why they cannot find PDO drivers? Please Help me. Thank u.</p>