我有问题
我已经在Ubuntu 18上安装了php7.1-fpm,并连接了所需的扩展名php_sqlsrv_71_nts.so和php_pdo_sqlsrv_71_nts.so,并安装了Microsoft教程中的所有库。在运行php7.1 -m或extension_loaded('sqlsrv')时,这些不丢失。但是,当我尝试以上述简单方式连接到db时:
$conn = sqlsrv_connect($serverName, $connectionOptions);
if ($conn === false) {
print_r(sqlsrv_errors());die();
} else {
echo 'fine';
}
我收到以下错误:
Array
(
[0] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => 10054
[code] => 10054
[2] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746
[message] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746
)
[1] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => 10054
[code] => 10054
[2] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
[message] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
)
)
连接凭据很好并且已检查
我想念什么?问题出现在哪一边?