A configuration problem under CentOS

Source: Internet
Author: User

This afternoon to configure the project when the PDO can not connect to the database, tried a lot of ways to find or not even, in the fast despair, finally found a and I met the same problem, the solution is as follows:

  

[Email protected] ~]# Getsebool-a | grep httpd

Allow_httpd_anon_write--off

Allow_httpd_mod_auth_ntlm_winbind--off

Allow_httpd_mod_auth_pam--off

Allow_httpd_sys_script_anon_write--off

Httpd_builtin_scripting-On

Httpd_can_check_spam--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-On

HTTPD_ENABLE_CGI-On

Httpd_enable_ftp_server--off

Httpd_enable_homedirs--off

Httpd_execmem--off

Httpd_manage_ipa--off

Httpd_read_user_content--off

Httpd_run_stickshift--off

Httpd_setrlimit--off

Httpd_ssi_exec--off

Httpd_tmp_exec--off

Httpd_tty_comm-On

Httpd_unified-On

Httpd_use_cifs--off

HTTPD_USE_GPG--off

Httpd_use_nfs--off

Httpd_use_openstack--off

Httpd_verify_dns--off

[Email protected] ~]# setsebool-p httpd_can_network_connect_db=1

Found finally can connect to the database, and then asked the next operation, only to know that may be selinux block access to the external database, can be shut down, as follows:

/usr/sbin/setenforce 0 Close SELINUX immediately
/usr/sbin/setenforce 1 Enable SELINUX now

Add to system default boot inside
echo "/usr/sbin/setenforce 0" >>/etc/rc.local

A configuration problem under CentOS

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.