We can connect to a specific url with linux (centos 6) commandline (curl, wget,...)

But we can't connect to it by webserver (apache) or php.

I did setenforce 0 command, after that webserver and php can connect.

Which selinux rule cause this problem and how can connect by webserver(or php) when selinux is enabled ?

  • solved by: setsebool httpd_can_network_connect=1
    – Metalik
    May 4, 2015 at 8:16
  • Please post that as an answer and accept it. Ideally, clearly explain what file you had to add that line to.That way, the question can be marked as solved.
    – terdon
    May 4, 2015 at 13:03

1 Answer 1


You can use setsebool httpd_can_network_connect=1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .