Hello everyone,
In brief:
OK so the problem itself: I have created a db.php file to connect from the IIS server to the SQL server, but I keep running into issues. At first I would get an http 500 error on the page and not see anything else. Then I made some changes and it came up with a "error locating server/instance specified" error (found below). Made some more changes and it came back to the http 500 error.
Further details:
I have a 4 server setup I'm trying to make work. Two of the servers are running IIS and two are running a failover cluster of microsoft sql server. (This may not be the correct way to say it sorry).
Server 1: IIS
Server 2: IIS
Server 3: MS SQL
Server 4 MS SQL
I have already setup those servers. What I am trying to do now is connect to a database on Server 3 from Server 1 using php. I have installed "PHP 5.6.0" and the "Microsoft Drivers 3.2 for PHP v 5.6 for SQL Server in IIS" from Web PI.
I have also set up FastCGI module mapping inside of the IIS manager.
db.php file i am testing...
$serverName = "(SERVERNAME\SERVERINSTANCE)";
//$uid = "(user)"
//$pwd = "(password)"
$connectionInfo = array( "Database"=>"databasename");
//$connectionInfo = array("UID" => $uid, "PWD" => $pwd, "Database"=>"databasename");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn )
{
echo "Connection established.\n";
}
else
{
echo "Connection could not be established.\n";
die( print_r( sqlsrv_errors(), true));
}
//-----------------------------------------------
// Perform operations with connection.
//-----------------------------------------------
/* Close the connection. */
sqlsrv_close( $conn);
?>
Running this file with the correct server name, instance name, and database name gets me: