LAMP架构中,php 与 php、php与C语言程序等 之间 的网络通信 问题

问题:

php(客户端) 不能连接 php(服务器端)   或者   php(客户端) 不能连接 C语言程序(服务器端)


解决:

[root@localhost ~]# getsebool -a|grep http
allow_httpd_anon_write --> off
allow_httpd_bugzilla_script_anon_write --> off
allow_httpd_cvs_script_anon_write --> off
allow_httpd_mod_auth_pam --> off
allow_httpd_nagios_script_anon_write --> off
allow_httpd_prewikka_script_anon_write --> off
allow_httpd_squid_script_anon_write --> off
allow_httpd_sys_script_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_can_network_relay --> off
httpd_can_sendmail --> on
httpd_disable_trans --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> on
httpd_read_user_content --> off
httpd_rotatelogs_disable_trans --> off
httpd_ssi_exec --> off
httpd_suexec_disable_trans --> off
httpd_tty_comm --> on
httpd_unified --> on
httpd_use_cifs --> off
httpd_use_nfs --> off
[root@localhost ~]# setsebool httpd_can_network_connect on
// 重 启电脑, httpd_can_network_connect --> off


[root@localhost ~]# setsebool -P httpd_can_network_connect on
// 重 启电脑, httpd_can_network_connect --> on


学习selinux  http://book.51cto.com/art/200810/94193.htm

你可能感兴趣的:(LAMP架构中,php 与 php、php与C语言程序等 之间 的网络通信 问题)