php代碼很簡(jiǎn)單:
代碼如下:
linux本機(jī)下使用php mysql.php 可以查看運(yùn)行結(jié)果,但是 在我的windows瀏覽器下報(bào)錯(cuò):
代碼如下:
原因:
代碼如下:
發(fā)現(xiàn) httpd_can_network_connect --> off
解決方案:
原來(lái)是 SELINUX,所以我一般直接關(guān)閉SELINUX和 iptables ip6tables
代碼如下:
chkconfig --level 12345 ip6tables off
service iptables stop
service ip6tables stop
查看SELinux狀態(tài):
1、/usr/sbin/sestatus -v ##如果SELinux status參數(shù)為enabled即為開(kāi)啟狀態(tài)
SELinux status: enabled
2、getenforce ##也可以用這個(gè)命令檢查
關(guān)閉SELinux:
1、臨時(shí)關(guān)閉(不用重啟機(jī)器):
setenforce 0 ##設(shè)置SELinux 成為permissive模式
##setenforce 1 設(shè)置SELinux 成為enforcing模式
2、修改配置文件需要重啟機(jī)器:
修改/etc/selinux/config 文件
將SELINUX=enforcing改為SELINUX=disabled
新聞熱點(diǎn)
疑難解答
圖片精選