LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache and PHP5 Problem (FC4) (http://www.linuxquestions.org/questions/linux-software-2/apache-and-php5-problem-fc4-342621/)

jjwl89 07-12-2005 07:04 PM

Apache and PHP5 Problem (FC4)
 
I installed apache 1.3.33 on Fedora Core 4 and everything was working like it should. Then I installed PHP5 and MySQL and changed the httpd.conf file to process the php files and when I went to restart Apache after I modified the httpd.conf file, it would not start. This is what the result was:

[root@server libexec]# apachectl start
Syntax error on line 221 of /www/conf/httpd.conf:
Cannot load /www/libexec/libphp5.so into server: /www/libexec/libphp5.so:
cannot restore segment prot after reloc: Permission denied
/usr/sbin/apachectl start: httpd could not be started

I have setup Apache and PHP (same versions) on a Fedora Core 2 machine and it worked perfectly.

Any help is appreciated.

Nylex 07-13-2005 12:28 AM

Have you tried looking at line 221 of your httpd.conf for a start?

quakefiend 09-03-2005 11:33 PM

im having the same problem on slackware 10.1. (but with 2.4 core) most likely the culprit line in your mod_php.conf is something like:

LoadModule php5_module /lib/apache2/libphp5.so

>apachectl start
Syntax error on line 5 of /etc/apache2/mod_php.conf:
Cannot load /lib/apache2/libphp5.so into server: /lib/apache2/libphp5.so: cannot open shared object file: No such file or directory

im a newb so.. sorry if this is an easy fix. Seems like a lot of people are having problems with apache2 + php5 though. should I tryt to recompile the kernel to 2.6.x?

Chikuku 07-20-2006 07:44 AM

I had this error using Fedora Core 5, Apache 2.2.0, OpenSSL 0.9.8a and PHP 5.1.4. It was frustrating seeing lots of requests for help and no answers so I'll put this here and see what happens.

I searched the web based on the error: cannot restore segment prot after reloc

Got the following "answer".
chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so
This worked but I do get this message when the server is started;
[Thu Jul 20 22:12:27 2006] [warn] module php5_module is already loaded, skipping
Perhaps a guru can tell me what I've done and the consequences. At the moment all I know is that php is now working with apache and the SSL module.

tomdkat 02-18-2007 12:36 AM

Quote:

Originally Posted by Chikuku
I had this error using Fedora Core 5, Apache 2.2.0, OpenSSL 0.9.8a and PHP 5.1.4. It was frustrating seeing lots of requests for help and no answers so I'll put this here and see what happens.

I searched the web based on the error: cannot restore segment prot after reloc

Got the following "answer".
chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so
This worked but I do get this message when the server is started;
[Thu Jul 20 22:12:27 2006] [warn] module php5_module is already loaded, skipping

Thanks for posting this since this solved my problem! Check your httpd.conf file to make sure you don't have two LoadModule entries for libphp5.

After running the chcon command above, my Apache server started without and warnings or problems. :)

Peace...

istong 06-07-2007 08:59 PM

apache 2 and php 5 permission error loading apache
 
Thanks for the posting. I found other postings that did not work. Some useful info - go to the directory where the file is that you are getting the permission errors on.

Then type ls --lcontext (or ls -lcontext on some systems)

some postings said if you are using SELINUX then type setenforce 0 as a test. If it works that confirms things. setenforce 1 turns selinux checks back on.

To fix it as indicated type
chcon -t texrel_shlib_t /usr/lib/httpd/modules/*.so

(other posts suggest chcon -t shlib_t .... but that did not work. you need the chcon -t texrel_shlib_t ...)


Thanks,

Ian Stong
ccie4u.com


All times are GMT -5. The time now is 11:15 PM.