关于 php 配置有关问题
程序员文章站
2022-06-08 08:18:58
...
关于 php 配置问题
环境: win7 iis7.5 php5.3.10 mssql 2008
要用php 连接sql下的微软的sqlsrv。 装好可以hello world
使用测试微软的测试用例:
结果出现这个:
Could not connect. Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. [message] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. ) [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] => 53 [code] => 53 [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. ) )
这他娘是怎么一会事。我搞了两天了。要疯掉了。 谁能救命
------解决方案--------------------
$serverName = "'local'";
$conn = sqlsrv_connect( $serverName);
????
连接数据库连用户名都不要吗?什么时候这样大方了?
local 表示当前服务i中唯一的实例,家那么多引号干什么
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------
环境: win7 iis7.5 php5.3.10 mssql 2008
要用php 连接sql下的微软的sqlsrv。 装好可以hello world
使用测试微软的测试用例:
- PHP code
$value) { echo $key.": ".$value."\n"; } } else { echo "Client info error.\n"; } /* Close connection resources. */ sqlsrv_close( $conn); ?>
结果出现这个:
Could not connect. Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. [message] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. ) [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] => 53 [code] => 53 [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. ) )
这他娘是怎么一会事。我搞了两天了。要疯掉了。 谁能救命
------解决方案--------------------
$serverName = "'local'";
$conn = sqlsrv_connect( $serverName);
????
连接数据库连用户名都不要吗?什么时候这样大方了?
local 表示当前服务i中唯一的实例,家那么多引号干什么
------解决方案--------------------
如需要阅读该回复,请登录或注册CSDN!
------解决方案--------------------
如需要阅读该回复,请登录或注册CSDN!
------解决方案--------------------
如需要阅读该回复,请登录或注册CSDN!
相关文章
相关视频
上一篇: php怎么判断字符串是几位
下一篇: php怎么判断字符串是几位