[Resolvido] Conexão PHP e MS Sql Server
Boa tarde pessoal, tudo bem?
Estou com uma certa dificuldade em conectar ao servidor de banco de dados Sql Server.
Podem me dar uma força?
O servidor esta correto.
Já tentei várias instancias (sqlexpress, SVDCBD01..).
O usuário existe e conecta ao servidor.
O servidor permite conexão remota.
Código:
<?php
echo '<pre>';
$serverName = "192.168.0.11\SVDCBD01";
$connectionInfo = array( "Database"=>"CorporeRM", "UID"=>"****", "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));
}
?>
Erro:
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.
)
)Discussão (5)
Carregando comentários...