PHP 5.5.12 + SQL Server 2008

Enviada por OnData 
OnData
PHP 5.5.12 + SQL Server 2008
21 de May de 2014 às 04:46PM
Estou usando o WAMP 2.5 (Apache 2.4.9, PHP 5.5.12) e SQL Server 2008 R2.
Tenho que conectar as informações do banco de dados ao site mas não consigo de modo algum realizar a conexão. Sempre retorna "Call to undefined function sqlsrv_connect()" ou "Call to undefined function mssql_connect()" dependendo qual extensão eu usar.

Já usei outras versões antigas do WAMP, já usei o XAMPP mas a dificuldade permanece. Já coloquei os drivers da Microsoft em C:\wamp\bin\php\php5.5.12\ext e os inseri no php.ini (descomentados), ja coloquei a DLL ntwdblib.dll (versão 2000.80.194.0) em c:\windows\system32, em c:\wamp\bin\php\php5.5.12\ e em c:\wamp\bin\apache\apache2.4.9\bin, e mesmo com tudo isto estou sem solução.

Não sei se o PHP não consegue ler as DLLs php_mssql.dll e php_sqlsrv_xx_xx.dll ou simplesmente não define as funções mssql_connect e sqlsrv_connect.
OnData
Re: PHP 5.5.12 + SQL Server 2008
21 de May de 2014 às 05:55PM
Consegui fazer funcionar.
Usei umas DLLs não oficiais para PHP5.5 que achei em http://www.hmelihkara.com/files/php_sqlsrv_55.rar e a comunicação passou a ocorrer entre o PHP e o SQL.

Agora me retorna

Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 10061 [code] => 10061 [2] => [Microsoft][SQL Server Native Client 11.0]TCP Provider: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente. [message] => [Microsoft][SQL Server Native Client 11.0]TCP Provider: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente. ) [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] => 10061 [code] => 10061 [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. ) )
Você precisa estar logado no PHPBrasil.com para poder enviar mensagens para os nossos fóruns.

Faça o login aqui.