FC有关 编译程序不能加载动态链接库的问题

解决Fedora Core 3及后续版本中Apache无法加载libphp4.so模块的问题

Fedora Core 2开始就已经有了SELinux (Security-Enhanced Linux )这个东西,不过在 FC2下是默认不打开的,从FC3开始就默认打开了,但是打开了是很安全,但是很多操作也不能操作了。
比如再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再搞鬼,哼,把你给关了。
使用文本编辑工具打开 /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
保存,关闭。
重启系统,然后看看我们的Apache已经能够运行PHP了。呵呵。
如果你碰到其他类似提示:
cannot restore segment prot after reloc: Permission denied
哪应该是SELinux的问题,可以考虑把它关闭。

please do as follows:

go to the menu :
System->Administration->Security Level and Firewall
disable SELinux and try again.
引用通告地址: 点击获取引用地址
标签: Fedora Core,linux,
评论: 0 | 引用: 0 | 阅读: 427 | 打印 | 打包 | 转发
 加入网摘