cannot restore segment prot after reloc message - PHP / httpd
Archive - Originally posted on "The Horse's Mouth" - 2008-06-26 06:36:58 - Graham EllisHere's a message that we got yesterday when building some of the machines on our Lamp deployment course
[root@easterton apache2]# ./bin/apachectl start
Syntax error on line 233 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
[root@easterton apache2]#
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 just turned enforcement off ..
[root@easterton apache2]# setenforce 0
[root@easterton apache2]# ./bin/apachectl start
[root@easterton apache2]#
(Note Linux's usual "no news is good news" confirmation that this has worked!)
Extra Note - the setenforce 0 should also be run before you do your make install for PHP ... to prevent the following error:
Installing PEAR environment: /usr/local/lib/php
/home/graham/haddenham/php-5.2.5/sapi/cli/php: error while loading
shared libraries: /usr/local/mysql/lib/libmysqlclient.so.16: cannot
restore segment prot fter reloc: Permission denied
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2