Quantcast
Channel: Microsoft Drivers for PHP for SQL Server forum
Viewing all articles
Browse latest Browse all 163

How set connection to remote SQL server 2008 r2 with PHP 5.4 and driver versi 3.0, using IIS 7.5

$
0
0

Hi .. i need a help. 

in my machine i am using windows 7 sp1 32 bit, using IIS 7.5 web server, PHP 5.4 32 bit that already integrated in IIS 7.5, and driver php sqlserver version 3.0. in other machine, my server use windows server 2008 r2 64 bit for sql server 2008r2. How can i connect to the database server? i am try to follow many tutorial and still stuck. i try to connet eith this code :

 <?php$serverName = "10.102.4.160\\sqldb64-2"; //serverName\instanceName// Since UID and PWD are not specified in the $connectionInfo array,// The connection will be attempted using Windows Authentication.$connectionInfo = array( "Database"=>"dbName", "UID"=>"sa", "PWD"=>"pwd");$conn = sqlsrv_connect( $serverName, $connectionInfo);if( $conn ) {     echo "Connection established.<br />";}else{     echo "Connection could not be established.<br />";     die( print_r( sqlsrv_errors(), true));}//SQLDB-CLU?>

and i still can not connect with this error

"Connection could not be established.
Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => -1 [code] => -1 [2] => [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. [message] => [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][SQL Server Native Client 11.0]Login timeout expired [message] => [Microsoft][SQL Server Native Client 11.0]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => -1 [code] => -1 [2] => [Microsoft][SQL Server Native Client 11.0]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. [message] => [Microsoft][SQL Server Native Client 11.0]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 am try to install native client 2012  too in my machine. now what the problem ? i must use authentication for log in windows too?  the 10.102.4.160 is server database that can access from remote desktop or using sql managment studio or using visual studio 2005 from my machine.

Thanks.

Stefanus.




Viewing all articles
Browse latest Browse all 163

Trending Articles