1

I have an issue

I've installed php7.1-fpm on Ubuntu 18 and connected required extensions php_sqlsrv_71_nts.so and php_pdo_sqlsrv_71_nts.so and installed all libraries from Microsoft tutorial. While running php7.1 -m or extension_loaded('sqlsrv'), those are not missing. However, when I'm trying to connect to db in a simple way explained above:

$conn = sqlsrv_connect($serverName, $connectionOptions);
if ($conn === false) {
    print_r(sqlsrv_errors());die();
} else {
    echo 'fine';
}

I receive following errors:

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
        )

)

Connection credentials are fine and checked

What am I missing? On which side problem appear?

Sheruan Bashar
  • 506
  • 4
  • 7

0 Answers0