title: Call to undefined function sqlsrv_connect() - Troubleshooting
body: <p><strong>System Information</strong></p>
  
  <p>CMS: Wordpress</p>
  
  <p>Web Server: XAMPP</p>
  
  <p>PHP Version: 5.5.30</p>
  
  <p>MS Management Studio 17</p>
  
  <p><strong>Goal</strong></p>
  
  <p>Establish MSSQL Database connection using PHP</p>
  
  <p><strong>What has been done</strong></p>
  
  <ol>
  <li>Downloaded SQLSRV Drivers</li>
  <li>Copied files <strong>php_pdo_sqlsrv_55_nts.dll</strong> and <strong>php_pdo_sqlsrv_55_ts.dll</strong> to the directory <code>C:\xampp\php\ext</code></li>
  <li>Added the following lines to the dynamic extensions part in the php.ini file: <code>extension=php_pdo_sqlsrv_55_ts.dll</code> and <code>extension=php_pdo_sqlsrv_55_nts.dll</code></li>
  <li>Restarted Web Server</li>
  <li>Confirmed sqlsrv is listed in phpinfo()</li>
  </ol>
  
  <p><strong>Code</strong></p>
  
  <pre><code>$serverName = "technology-pc\sqlexpress";
  
  // The connection will be attempted using Windows Authentication.
  $connectionInfo = array( "Database"=&gt;"example_db");
  $conn = sqlsrv_connect($serverName, $connectionInfo);
  
  if( $conn ) {
       echo "Connection established.&lt;br /&gt;";
  } else {
       echo "Connection could not be established.&lt;br /&gt;";
       die( print_r( sqlsrv_errors(), true));
  }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>Call to undefined function sqlsrv_connect()</p>
  </blockquote>