Today I have faced a weired problem. I have compiled apache-php so many times till today. BUt havn’t faced this kind of problem.
Installation of both packages were fine without any error. As soon as I completed installation, I stopped apache, but I cant. The following error appeared.
” Syntax error on line xxx 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 ”
After googling for whole day I have found the solution. Actually this is NOT a syntax error in the httpd.conf file in spite of the error message – but it does (correctly) point to a line number at which it had an issue.And in this case the issue is … the security setting for SELinux that was selected at the time the operating system was installed.
To get past the problem and allow the PHP Install to complete, we need to just turned enforcement off ..
e.g. [root@ superbox ]# setenforce 0
[root@superbox]# /usr/local/apache2/bin/apachectl start
Gr8 ….Its started……..
What this command do exactly?
Setenforce change the mode of SELinux is running in.
Synopsis: “setenforce [ Enforcing | Permissive | 1 | 0 ]”
Use Enforcing or 1 to put SELinux in enforcing mode. Use Permissive or
0 to put SELinux in permissive mode. You need to modify /etc/grub.conf
or /etc/selinux/config to disable SELinux.