title: PHP Sql Server PDOException:could not find driver
body: <p>My server is a Windows 2008 server. PHP Version 7.2.7 is installed and running. Sql Server 11 (64 bit) is installed and is working (there is a couple asp.net apps running and already using that database)</p>
  
  <p>I downloaded the PHP Sql Server Drivers from Microsofts website and placed the .dll files in the PHP ext directory. </p>
  
  <p>In my PHP.ini I added:<code>extension=php_pdo_sqlsrv_7_nts_x64</code></p>
  
  <p>In my .php file I am using to test my db connection I have:</p>
  
  <pre><code> $SqlServer = "THISSERVER\SQLEXPRESS";
   $SqlServerCon = new PDO("sqlsrv:server=$SqlServer;Database=TheDatabase", "DbUName", "DbPassword"); 
  if (!$SqlServerCon) {die('Unable To Connect to Sql Server');}
  else
  {echo "Connection Successful";}     
  </code></pre>
  
  <p>I am getting:
  <code>PHP Fatal error:  Uncaught PDOException: could not find driver in D:\Inetpub\wwwroot\TechStory2\DBtest.php:7</code> (Line 7 is the $SqlServerCon line). </p>
  
  <p>What did I do wrong? and What do I need to do to get a connection to Sql Server? </p>