I have included the driver in extension folder and added that extension in php.ini file too, wampp has version of 5.3. While connecting to sql server via php I am getting error which is below.
<?php
/** * CONNECTION TO SQL SERVER * CONNECTING VIA WINDOWS AUTHENTICATION */
/* Specify the server and connection string attributes. */
$serverName = "Wajahat\SQLEXPRESS";
$connectionInfo = array( 'Database'=>'modern_ecommerce');
/* Connect using Windows Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));
}
Try adding Integrated Security =true in connectring or add username and password. From the error it seems connection cannot be established