linux commandline can connect but webserver (or php) can't connect

7,054

You can use setsebool httpd_can_network_connect=1

Share:
7,054

Related videos on Youtube

Metalik
Author by

Metalik

peratik at gmail dot com

Updated on September 18, 2022

Comments

  • Metalik
    Metalik over 1 year

    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 ?

    • Admin
      Admin about 9 years
      solved by: setsebool httpd_can_network_connect=1
    • Admin
      Admin about 9 years
      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.