I have weird situation in newly installed server, and it seems that Google can\'t help me this time. I can\'t connect to (remote) mysql from my php-code. When I try to conn
On Fedora 21 with apache 2/httpd version 2.6 using php version 5.6 when connecting to a remote mysql server 5.6 or mariadb version 10. It even seems to be a problem connecting to local server when specifying the server's FQDN instead of localhost in the php code.
This command will fix the permissions problem for the current session:
setsebool httpd_can_network_connect_db on
To make the fix permanent for subsequent reboots you need to do this:
setsebool -P httpd_can_network_connect_db on
Thanks to all on this question for rescuing me from "permission denied" hell. :)