php不支持加载libphp5

Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
php安装好以后
apache2 无法启动
最后一步重新启动apache报如下错误
原因是Linux有一个SELinux保护模式引起的。
Syntax error on line 268 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
解决办法
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

你可能感兴趣的:(apache,C++,c,PHP,linux)