I'm using the Zend CE server with PHP 5.3.5 and Eclipse Helios with PDT to develop a database-driven PHP web application. I have my dev environment setup and enabled the SQL_Srv driver through the Zend control panel.
My problem is in my script when I call the sqlsrv_connect() function, it fails to connect to my SQL Server db and always returns false. I've verified I can connect to the server through a System DSN as well as Microsoft SQL Server Management Studio, so I know it's there and I can talk to it. These same settings also work on my coworker's dev environment (the same as mine), so I'm not sure what's missing. Has anyone else had similar issues with the PHP SQL Server driver? The relevant snippet of code:
$serverName = 'dbServer';
$connectionInfo = array ( "Encrypt" => 0, "LoginTimeout" => 10, "Database" => "Test_DB", "UID" => "ABC", "PWD" => "123" );
//This is always false. Does not connect
$test_Connect = sqlsrv_connect ( $serverName, $connectionInfo );
$GLOBALS['_connection'] = sqlsrv_connect ( $serverName, $connectionInfo );
if ( $GLOBALS['_connection'] == false ) {
print_r ( sqlsrv_errors(), true );
die ( "Failed to connect to SQL Server '$serverName'." );
}