when i run php script from browser sqlsrv mssql connection working.
but when i execute php script via ssh
command "/opt/alt/php-fpm70/usr/bin/php path/to/script.php"
sqlsrv_connect give this error:
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.
)
)
note: "sudo setsebool httpd_can_network_connect_db 1" i tried this but it didn't work