title: php - PDOException could not find driver
body: <p>I get PDOException could not find driver when connecting to mysql database with </p>
  
  <pre><code>$this-&gt;conn = new PDO("mysql:host=" . $this-&gt;host . ";dbname=" . $this-&gt;db_name, $this-&gt;username, $this-&gt;password);
  </code></pre>
  
  <p>on localhost on windows 10. I also tried replace localhost with 127.0.0.1.</p>
  
  <p>phpinfo():
  <a href="https://i.stack.imgur.com/AweU0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AweU0.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ndv20.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ndv20.png" alt="enter image description here"></a></p>
  
  <p>C:\php\php.ini:</p>
  
  <pre><code>extension_dir = "C:/php/ext"
  ;extension=php_bz2.dll
  ;extension=php_curl.dll
  ;extension=php_fileinfo.dll
  ;extension=php_gd2.dll
  ;extension=php_gettext.dll
  ;extension=php_gmp.dll
  ;extension=php_intl.dll
  ;extension=php_imap.dll
  ;extension=php_interbase.dll
  ;extension=php_ldap.dll
  ;extension=php_mbstring.dll
  ;extension=php_exif.dll
  extension=php_mysql.dll
  ;extension=php_mysqli.dll
  ;extension=php_oci8_12c.dll
  ;extension=php_openssl.dll
  ;extension=php_pdo.dll
  ;extension=php_pdo_firebird.dll
  extension=php_pdo_mysql.dll
  ;extension=php_pdo_oci.dll
  ;extension=php_pdo_odbc.dll
  ;extension=php_pdo_pgsql.dll
  ;extension=php_pdo_sqlite.dll
  ;extension=php_pgsql.dll
  ;extension=php_shmop.dll
  </code></pre>
  
  <p>C:\Apache24\conf\httpd.conf:</p>
  
  <pre><code>LoadModule php5_module "C:/php/php5apache2_4.dll"
  AddHandler application/x-httpd-php .php
  PHPIniDir "C:/php"
  </code></pre>
  
  <p>php -m</p>
  
  <pre><code>[PHP Modules]
  bcmath
  calendar
  Core
  ctype
  date
  dom
  ereg
  filter
  ftp
  hash
  iconv
  json
  libxml
  mcrypt
  mhash
  mysql
  mysqli
  mysqlnd
  odbc
  pcre
  PDO
  pdo_mysql
  Phar
  Reflection
  session
  SimpleXML
  SPL
  standard
  tokenizer
  wddx
  xml
  xmlreader
  xmlwriter
  zip
  zlib
  
  [Zend Modules]
  </code></pre>
  
  <p>C:\php\ext content:</p>
  
  <pre><code>25.10.2017  15:23            79 872 php_bz2.dll
  25.10.2017  15:23            87 040 php_com_dotnet.dll
  25.10.2017  15:23           478 208 php_curl.dll
  25.10.2017  15:23            23 040 php_enchant.dll
  25.10.2017  15:23            56 320 php_exif.dll
  25.10.2017  15:23         2 874 880 php_fileinfo.dll
  25.10.2017  15:23         1 504 768 php_gd2.dll
  25.10.2017  15:23            48 128 php_gettext.dll
  25.10.2017  15:23           359 936 php_gmp.dll
  25.10.2017  15:23           911 360 php_imap.dll
  25.10.2017  15:23            80 896 php_interbase.dll
  25.10.2017  15:23           326 656 php_intl.dll
  25.10.2017  15:23           218 624 php_ldap.dll
  25.10.2017  15:23         1 413 632 php_mbstring.dll
  25.10.2017  15:23            45 056 php_mysql.dll
  25.10.2017  15:23           113 664 php_mysqli.dll
  25.10.2017  15:23           147 456 php_oci8_12c.dll
  25.10.2017  15:23           158 208 php_opcache.dll
  25.10.2017  15:23           105 472 php_openssl.dll
  25.10.2017  15:23            24 576 php_pdo_firebird.dll
  25.10.2017  15:23            28 672 php_pdo_mysql.dll
  25.10.2017  15:23            28 672 php_pdo_oci.dll
  25.10.2017  15:23            24 576 php_pdo_odbc.dll
  25.10.2017  15:23            39 936 php_pdo_pgsql.dll
  25.10.2017  15:23           603 648 php_pdo_sqlite.dll
  25.10.2017  15:23           117 760 php_pgsql.dll
  25.10.2017  15:23            14 336 php_shmop.dll
  25.10.2017  15:23           406 528 php_snmp.dll
  25.10.2017  15:23           285 184 php_soap.dll
  25.10.2017  15:23            68 608 php_sockets.dll
  25.10.2017  15:23           761 856 php_sqlite3.dll
  25.10.2017  15:23            38 912 php_sybase_ct.dll
  25.10.2017  15:23           284 160 php_tidy.dll
  25.10.2017  15:23            63 488 php_xmlrpc.dll
  25.10.2017  15:23           285 696 php_xsl.dll
  </code></pre>
  
  <p>System Path:</p>
  
  <pre><code>C:\php
  C:\php\ext
  C:\Apache24
  C:\Apache24/bin
  </code></pre>
  
  <p>Do I need any more drivers? Or is there any other problem?</p>
  
  <p>If you need any more info I will provide it.</p>
  
  <p>Thank you for any suggestions</p>