1

I tried with this code, but "The wait operation timed out."

$server = "tcp:92.45.xx.xx,1433";
try {
    $conn = new PDO("sqlsrv:server=$server ; Database=SednaPortNature", "Markam", "Markam2019");
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $e) {
    die(print_r($e->getMessage()));
}

Edit: If i try connect to server inside remote server locally with server name ("PNSRV04") connected successfuly like that;

$serverName = "PNSRV03";
try {
    $conn = new PDO("sqlsrv:server=$serverName ; Database=SednaPortNature", "Markam", "Markam2019");
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $e) {
    die(print_r($e->getMessage()));
}

  • 1
    also tried, $server = "92.45.xx.xx,1433"; – Erdoğan Sönmez Apr 19 '19 at 13:09
  • What made you think `tcp:` was necessary? – RiggsFolly Apr 19 '19 at 13:14
  • @RiggsFolly can you check question. I searched but no answer. This is different question. – Erdoğan Sönmez Apr 19 '19 at 13:29
  • I would expect that there is something useful in the error message. Show us that as well please – RiggsFolly Apr 19 '19 at 13:34
  • @RiggsFolly İ wrote on first line, this is exception message `SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: The wait operation timed out. 1` – Erdoğan Sönmez Apr 19 '19 at 13:38
  • 1
    1) Check your SQL Server network configuration. You need to be sure, that SQL Server service is listening on port 1433. For Windows instances, go to SQL Server Configuration Manager (or Computer Management\Services and Applications\SQL Server Configuration Manager), then go to SQL Server Network Configuration, Protocols for "InstanceName". TCP/IP must be enabled. Then open Properties for TCP\IP. On "IP Addresses" tab, go to IPAll. Leave "TCP Dynamic ports" must be empty, and "TCP Port" must be set to 1433. 2) Check your firewall settings. – Zhorov Apr 19 '19 at 13:57

0 Answers0