如果直接安装完成apache,是直接可以启动的,但是和php结合后,就不能启动,报出错误
Syntax error on line 232 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
出现这个错误的原因是linux的SELinux保护模式引起的
解决方法:
1、关闭SELINUX
vi /etc/selinux/config
将SELINUX=enforcing 改成SELINUX=disabled
需要重新启动一下
2、不关闭SELINUX
# setenforce 0
# chcon -c -v -R -u system_u -r object_r -t textrel_shlib_r /usr/local/apache/modules/libphp5.so
# /usr/local/apache/bin/apachectl restart
# setenforce 1
阅读(1193) | 评论(0) | 转发(0) |