PHP statement
new PDO($nonLocalhostDsn)
Running from the shell
php index.php
Result = Connection OK
Running from a web browser
http://hostname/index.php
Result = Login timeout expired
new PDO($nonLocalhostDsn)
php index.php
Result = Connection OK
http://hostname/index.php
Result = Login timeout expired
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_can_network_connect_db=1