title: sql server for php 7.1.3 VS14
body: <p>i'm trying to connect sqlsvr to php on Apache server. Here are the details:</p>
  
  <p><strong>PHP Version 7.1.3</strong></p>
  
  <p><strong>PHP Extension Build:</strong>    API20160303,TS,VC14</p>
  
  <p>i downloaded the sqlsvr driver that is compatible for php version 7.1 from here: github.com/Microsoft/msphpsql/releases</p>
  
  <p>I copied <strong>php_pdo_sqlsrv_71_ts.dll</strong> and <strong>php_sqlsrv_71_ts.dll</strong> into <strong>C:\PHP\ext</strong> directory.</p>
  
  <p>Then i tried to locate the <strong>php.ini</strong> * file, but could only find the <strong>php.ini-production</strong> and <strong>php.ini-development</strong> in the C:\PHP directory.
  I read on another thread that in php 7+, they removed php.ini and said to use the php.ini-production one.</p>
  
  <p>Which i did, and added the the 2 extensions to php.ini-production:</p>
  
  <pre><code>extension=php_sqlsrv_71_ts.dll
  extension=php_pdo_sqlsrv_71_ts.dll.
  </code></pre>
  
  <p><strong>Note *:</strong> <strong>Loaded Configuration File</strong> is    (none) on my localhost site.</p>
  
  <p>I then restarted the Apache server, but it doesn't seem to be connected to the sqlsvr (i used phpinfo() to check).</p>
  
  <p>I can still connect to the site normally, nothing changes after trying to implement the sqlsvr</p>
  
  <p>I also tried using the drivers from Microsofts official page, but no success</p>
  
  <p>Any help would be much appreciated</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>So i sort of fixed it by doing the following:
  I copied everything in php.ini-development and make a new file called php.ini (which didn't exist before). I modified it by un-commenting these lines:</p>
  
  <pre><code>extension=c:/php/ext/php_curl.dll
  extension=c:/php/ext/php_gd2.dll
  extension=c:/php/ext/php_intl.dll
  extension=c:/php/ext/php_mbstring.dll
  extension=c:/php/ext/php_mysqli.dll
  extension=c:/php/ext/php_openssl.dll
  extension=c:/php/ext/php_soap.dll
  extension=c:/php/ext/php_xmlrpc.dll
  </code></pre>
  
  <p>And then i added these 2 lines:</p>
  
  <pre><code>extension=php_pdo_sqlsrv_71_ts.dll
  extension=php_sqlsrv_71_ts.dll
  </code></pre>
  
  <p>Now i restarted the Apache server, and how when i search for "sqlsrv", it's there. I also noticed that the <strong>Loaded Configuration File</strong> says   C:\PHP\php.ini instead of (none) now.</p>
  
  <p>I then googled a way to test if a connection is established and found this code, which i put into the C:\Apache24\htdocs\ directory and called it connect.php;</p>
  
  <pre><code>&lt;?php
  $serverName = "serverName\sqlexpress"; //serverName\instanceName
  $connectionInfo = array( "Database"=&gt;"dbName", "UID"=&gt;"userName", "PWD"=&gt;"password");
  $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));
  }
  ?&gt;
  </code></pre>
  
  <p>I restart the apache server and go to localhost/connect.php and get this msg: </p>
  
  <p><em>"Connection could not be established.
  Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server. Access the following URL to download the ODBC Driver 11 or 13 for SQL Server for x64: <a href="http://go.microsoft.com/fwlink/?LinkId=163712" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=163712</a> [message] => This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server. Access the following URL to download the ODBC Driver 11 or 13 for SQL Server for x64: <a href="http://go.microsoft.com/fwlink/?LinkId=163712" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=163712</a> ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) )"</em></p>
  
  <p>I go to the link, but the drivers only support up to php 7.0 (i have 7.1.3) But i try it anyways, and ofc it doesn't work.</p>