title: Could not find driver when connect PHP to SQL SERVER
body: <p>I want to connect to SQL Server at another pc with php, when i try to connect it says</p>
  <blockquote>
  <p>Connection error: could not find driver</p>
  </blockquote>
  <p>What I have tried is add extension in <code>php.ini</code>.</p>
  <blockquote>
  <p>;extension=php_sqlsrv_56_ts.dll</p>
  <p>extension=php_pdo_sqlsrv_72_ts_x64.dll</p>
  <p>extension=php_sqlsrv_72_ts_x64.dll</p>
  </blockquote>
  <ol>
  <li>my PHP version is: 7.2.3</li>
  <li>SQL SERVER: SQL Server 2014</li>
  <li>OS PC: Windows Server 2012 R2 (another pc)</li>
  </ol>
  <p>here's my code:</p>
  <pre><code>&lt;?php
  $host = &quot;192.168.3.126&quot;;
  $db_name = &quot;dbo&quot;;
  $username = &quot;david&quot;;
  $password = &quot;david&quot;;
  try {
  //$con = new PDO(&quot;mysql:host={$host};dbname={$db_name}&quot;, $username, $password);
  $db = new PDO(&quot;sqlsrv:Server={$host};Database={$db_name}&quot;, $username, $password); 
  }
  catch(PDOException $exception){ echo &quot;Connection error: &quot; . $exception-&gt;getMessage();}
  ?&gt;
  </code></pre>
  <p>NB: I have download <code>Microsoft Drivers 5.6 for PHP for SQL Server</code> <a href="https://docs.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server?view=sql-server-2017" rel="nofollow noreferrer">at here</a>, I have download  install the ODBC Driver 17 at my own pc</p>
  <p>I have tried this reference but it doesn't work <a href="https://stackoverflow.com/questions/51449210/php-sql-server-pdoexceptioncould-not-find-driver">PHP Sql Server PDOException:could not find driver</a></p>