PHP5.4连接sql server2008时 连接失败 以下是代码和报错信息 求高手指点

代码:
var_dump(function_exists('sqlsrv_connect'));
所有变量均已经负值
$connectionInfo = array("UID"=>$uid,"PWD"=>$pwd,"Database"=>"tupoemanager");
$conn = sqlsrv_connect( $serverName,$connectionInfo);

if( $conn == false)
{
echo "连接失败!";
die( print_r( sqlsrv_errors(), true));
}
报错信息
boolean true //证明sqlsrv的扩展已经生效

Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 2 [code] => 2 [2] => [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2]. [message] => [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2]. ) [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] => 2 [code] => 2 [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. ) )

第1个回答  2013-12-03
你好,我也遇到和你一样的问题,错误也是一模一样,请问你解决了吗?求助啊!!!谢谢!
第2个回答  2013-11-22
看你的错误信息,使用命名管道连接。由于没有测试环境,请不妨参考PHP相关文档。也可以参考http://www.cnblogs.com/wesgong/archive/2013/03/14/2959328.html,看看是否能解决你的问题。
第3个回答  2013-12-28
请问你现在这个问题知道怎么解决了吗?我现在也是遇到这样,不知道怎么解决,我这电脑还是win7的,还要在win8上面弄。
相似回答
大家正在搜