RESOLUTION
SYMPTOMS:
I have problem getting the PHP/Apache on the Plesk server to work with the external Mysql database. Connection from PHP scripts to the remote database always fails. However we can connect to the database server from SSH on the web server with "mysql -h hostname -u user -p". We made a small php script that simply tries to connect to the remote database. When running the php script in ssh on the web server it works just fine. But when running it under Apache we get a connection failure no matter what we do.
RESOLUTION:
Please check if selinux is enabled in the system. If yes, try to disable it as described in 1636 or allow remote connections for Apache with:
# setsebool -P httpd_can_network_connect=1 There are other selinux restrictions which can affect the server in the future. You can get the full list with the command 'getsebool -a'.