PHP Version 5.4, Apache Version 2.4, CentOS 7.3
Trying to connect to mssql db using the following php code which works fine when I run it from the command line. However, when I place code under apache (on same server) and call through browser I get a timeout error.
Error: Connection failed: SQLSTATE[HYT00] SQLConnect: 0 [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired+
set_time_limit(30);
echo "+ Connection\n";
try {
$pdo = new PDO("odbc:sqlsrv_msodbc", "username", "password");
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}