I have a server that is running Windows Server 2008 R2, 64-bit. It has PHP 5.6.4 installed on it running via IIS7. I'm trying to connect to a SQL database that resides on a different server. There is no official SQL extension for PHP 5.6.4 so I have downloaded one that I found here
that others seem to have success with. I still can't get my script to connect.
I've tried connecting to the SQL server from yet another server running an older version of PHP for which there is an official PHP SQL extension and it connects without a problem. I'm even able to successfully telnet to the SQL server on port 1433 and it answers. Therefore, I know there's not a problem connecting to the remote SQL server due to a networking issue.
To test whether or not I'm able to connect, I have the following in my script:
$serverName = "<<SERVER IP ADDRESS>>";
$uid = "login";
$pwd = "password";
$connectionInfo = array( "UID"=>$uid,"PWD"=>$pwd,"Database"=>"Database_name");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
I have E_ALL & ~E_DEPRECATED set for error_reporting and display_errors is set to On. I get no errors whatsoever. All i get is "fails".
What is it that could be holding me up?
The attached image shows the pertinent sections from running phpinfo on the server that is running 5.6.4. I've compared these sections to the server running the older version of PHP and they are the same.