Ошибка php sqlsrv Поставщик TCP: код ошибки 0x271D

когда я запускаю php-скрипт из браузера, соединение sqlsrv mssql работает.

но когда я выполняю PHP-скрипт через ssh

команда "/opt/alt/php-fpm70/usr/bin/php путь/to/script.php"

sqlsrv_connect выдает эту ошибку:

      Array
(
[0] => Array
(
     [0] => HYT00
     [SQLSTATE] => HYT00
     [1] => 0
     [code] => 0
     [2] => [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
     [message] => [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
)

[1] => Array
    (
        [0] => 08001
        [SQLSTATE] => 08001
        [1] => 10013
        [code] => 10013
        [2] => [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x271D
        [message] => [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x271D
    )

[2] => Array
    (
        [0] => 08001
        [SQLSTATE] => 08001
        [1] => 10013
        [code] => 10013
        [2] => [Microsoft][ODBC Driver 17 for SQL Server]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][ODBC Driver 17 for SQL Server]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.
    )
)

примечание: «sudo setsebool httpd_can_network_connect_db 1» я попробовал это, но это не сработало

0 ответов

Другие вопросы по тегам