PHP access Network exception after SELinux is enabled

Source: Internet
Author: User

APACHE03 Access Test Connection Http://admin.lt.mopgaming.com/auth/admin/login

Ping and Telnet specify that the appropriate port test will succeed,

However, when the firewall is enabled, the memcached and Redis ports are already in place, testing the connection is still unsuccessful.

Error:{"message": "Permission denied [tcp:\/\/198.44.240.242:6379]", "Code": "Data": null}{"message": " Undefined index: _sf2_meta "," code ": +," data ": null}


Problem reason to open selinux

Getsebool-a |grep httpd

[Email protected] ~]$ getsebool-a |grep-i httpd

Httpd_anon_write--off

Httpd_builtin_scripting-On

Httpd_can_check_spam--off

Httpd_can_connect_ftp--off

HTTPD_CAN_CONNECT_LDAP--off

Httpd_can_connect_mythtv--off

Httpd_can_connect_zabbix--off

Httpd_can_network_connect--off

Httpd_can_network_connect_cobbler--off

httpd_can_network_connect_db--off

Httpd_can_network_memcache--off

Httpd_can_network_relay--off

Httpd_can_sendmail--off

Httpd_dbus_avahi--off

HTTPD_DBUS_SSSD--off

。。。

You can see that selinux restricts access to external access to httpd

Setsebool-p httpd_can_network_connect=1

Immediate effect, you can access


Or, if you are unfamiliar with SELinux, turn off SELinux directly

Setenforce 0 Immediate effect

Getenforce

Or

/etc/sysconfig/selinux

Selinux=disabled Direct shutdown, restart effective




PHP access Network exception after SELinux is enabled

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.