php连接sql server2008时总提示有错误,用的是sqlsrv_connect()

Connectioncouldnotbeestablished.Array([0]=>Array([0]=>08001[SQLSTATE]=>08001[1]=>53[c... Connection could not be established. Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. [message] => [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired [message] => [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][ODBC Driver 11 for SQL Server]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][ODBC Driver 11 for SQL Server]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. ) )
到底是什么错误啊?大家可以帮帮我吗?谢谢
展开
 我来答
isolxm
推荐于2016-10-18 · 超过41用户采纳过TA的回答
知道小有建树答主
回答量:92
采纳率:50%
帮助的人:37.4万
展开全部
连接数据库失败。这种报错一般不是你的程序问题。
多数原因如下:
1、烂改网络端口不通。检查防火墙。
2、sql server 服务没有起。请启动数据库有服务
3、新装的sql server ,就算是服务起来了,铅历桥默认只能本地槐猛连接 。需要手动开启远程连接。
追问
谢谢,这个问题已经解决了
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式