最後一步重新啟動apache報如下錯誤:httpd: Syntax error on line 53 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_t /usr/local/apache/modules/libphp5.so
# service httpd restart
# setenforce 1