比如再FC4下装Apache + PHP,手工编译的,但是去无法解析PHP,看错误提示,都是什么:
引用:[root@localhost ~]# /usr/local/apache/bin/apachectl start Syntax error on line 232 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp4.so into server: /usr/local/apache/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied
郁闷了,总是无法加载libphp4.so这个包,想了半天没有结果,搜索一下,原来是SELinux再搞鬼,哼,把你给关了。
使用vi/gedit/kate/bluefish任何的文本编辑工具打开 /etc/selinux/config,找到这段:
找到这段:
引用:# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。
然后再使用文本编辑工具打开:/etc/sysconfig/selinux,找到:
引用:# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行:
SELINUX=disabled
保存,退出。
重启系统,然后看看我们的Apache已经能够运行PHP了。呵呵。
如果你碰到其他类似提示:
引用:cannot restore segment prot after reloc: Permission denied
哪应该是SELinux的问题,可以考虑把它关闭。