q***l
应用程序环境:本地IP:10.60.56.90,本地电脑上安装Apache 2.2.3和php 5.1.6,远程数据库服务器IP:10.60.56.220,数据库是mysql 5.0.45,本地系统和远程系统都是centos 5.3。 解决方法完全来自于http://www.ehow.com/how_209****_connect-remote-database-under-selinux.html,解决方法异常简单,只需要在本地电脑上运行一条命令: setsebool -P httpd_can_network_connect=1 当然,要有http服务器上的root权限,因为只有root用户才能管理selinux。 关于selinux的详细知识,参见 百度百科:http://baike.baidu.com/view/487687.htm WIKI:http://en.wikipedia.org/wiki/Security-Enhanced_Linux selinux project:http://selinuxproject.org/page/Main_Page 在http://docs.fedoraproject.org/selinux-managing-confined-services-guide/可以下载到selinux的设置文档,其中有一章是专门讲解apache的设置参数的,除了apache以外,还有ftp, mysql, cvs, bind, scp, nfs, samba等等一些服务的参数。