I'm using PHP 7.0.15, running IIS locally, and I'm trying to connect to our main SQL Server box. I have successfully loaded the sqlsrv extension, tested with
echo "Did sqlsrv load? " . (extension_loaded('sqlsrv') ? "YES" : "NO");
which returns YES. The SQL instance on the box I'm connecting to is hdnysql1\hdnysql1, verified with select @@serverName. I've checked that I can connect running SQL Server Management Studio using Windows authentication, and I'm trying to use Windows authentication in the code:
$servername = "hdnysql1\hdnysql1";
$connectionInfo = array("Database"=>"MCDB_Test");
$conn = sqlsrv_connect($serverName, $connectionInfo);
This returns a connection failure; sqlsrv_errors returns an array including
Named Pipes Provider: Could not open a connection to SQL Server
Login timeout expired
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
I followed the instructions here and verified that remote connections are allowed to the server. The TCP port setting in SQL Server Configuration Manager was blank; I set it to 1433 on IP2, restarted services, and things appear to be working; SSRS had to be restarted too but that's working OK. I telnetted to the server on port 1433 to be sure it was open and disabled my firewall, and still no luck -- still getting the same message. Any help would be much appreciated.