使用的微软的驱动,PHP也有已经加载成功,但是连接的时候总是连接不上去;
报错信息:
Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => -1 [code] => -1 [2] => [Microsoft][SQL Server Native Client 10.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. [message] => [Microsoft][SQL Server Native Client 10.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 10.0]Login timeout expired [message] => [Microsoft][SQL Server Native Client 10.0]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => -1 [code] => -1 [2] => [Microsoft][SQL Server Native Client 10.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 10.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. ) )
服务器挂了???<divclass="ref">
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:normal;background-color:#FFFFFF;">sqlsrv_connect连接跟标准的不太一样,把你写的帖出来看看
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:normal;background-color:#FFFFFF;">
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:normal;background-color:#FFFFFF;">sqlsrv_connect连接跟标准的不太一样,把你写的帖出来看看
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:normal;background-color:#FFFFFF;">
sqlsrv_connect
跟pdo_sqlsrv没有关系
找到你的php
报错信息给的很清楚,看下SQLSERVER的协议选项里头的NameedPipes是否启用, sqlserver实例名对不对,是否允许远程连接
你可以在SQLServer配置管理器中查看下
我最近在一个项目中也用到sqlsrv
回复<aclass='referer'target='_blank'>@羞女爱绳缚:实例名称呢肯定有允许的,如果没有允许,连pdo连接都不能成功了,估计!
你最好把你的sqlserver版本发出来
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。