0

I configured EC2 instance with following environment

Centos 7.4 , PHP 5.4 , HTTPD 2.4

From this EC2 instance when I heat external DB connection request through web page it turns out to be connection timeout , while If I run same PHP script through CLI it works fine any connects with database. Also I did telnet on remote DB server on port 3306 it gots connected.

I have tried by disabling selinux "setenforce 0" and allowed apache to make remote connections

setenforce 0
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1

But nothing worked.

coder
  • 283
  • 4
  • 26
  • Was there evidence (e.g., messages in your audit logs) that this was an selinux issue? Are there any relevant messages in your web server's error logs? – larsks Dec 22 '17 at 17:30
  • No there is no such message , but its very strange if php script is able to connect with remote mysql server then same script giving connection timeout while running through HTTP request. – coder Dec 23 '17 at 02:24

0 Answers0