I'm trying to access a SQL server from another Ubuntu 16.04 server using PHP, I made the entire drive installation process informed by Microsoft's own website and in phpinfo the installed drive is shown as shown in the images, however when I go connecting to the bank shows the error:
Error !: SQLSTATE [HYT00]: [unixODBC] [Microsoft] [ODBC Driver 13 for SQL Server] Login timeout expired
PHPVersion7.1.3-2+deb.sury.org~xenial+1
Thefollowingistheconnectioncode:
try{$db_host='HOST';$db_username='USER';$db_password='PASS';//$dsn="mysql:dbname=test;host={$db_host}";
$dsn = "sqlsrv:database=test;server={$db_host}";
$conn = new PDO($dsn, $db_username, $db_password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}