I have a very simple test script:
If this is a Red Hat-derived distribution (RHEL, CentOS, Fedora, ScientificLinux) running SELinux (or any non Red Hat derivative using SELinux), the default policy setting at time of this writing is to prohibit Apache from making external connections to other servers or databases. As root, you must enable the following two SELinux booleans. Use the -P
option to persist the change across a reboot.
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_can_network_connect_db=1
Note that httpd_can_network_connect
may not be necessary. Try it first turning on only httpd_can_network_connect_db
.