Score:0

php sqlsrv error TCP Provider: Error code 0x271D

mq flag

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

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.