LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-12-2005, 07:04 PM   #1
jjwl89
LQ Newbie
 
Registered: Dec 2004
Posts: 5

Rep: Reputation: 0
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.
 
Old 07-13-2005, 12:28 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Have you tried looking at line 221 of your httpd.conf for a start?
 
Old 09-03-2005, 11:33 PM   #3
quakefiend
LQ Newbie
 
Registered: Sep 2005
Location: Texas
Distribution: slackware
Posts: 2

Rep: Reputation: 0
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?
 
Old 07-20-2006, 07:44 AM   #4
Chikuku
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
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.
 
Old 02-18-2007, 12:36 AM   #5
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
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...
 
Old 06-07-2007, 08:59 PM   #6
istong
LQ Newbie
 
Registered: Jun 2007
Posts: 1

Rep: Reputation: 0
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
 
  


Reply

Tags
apache2, php5, selinux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help installing PHP5 for Apache blizunt7 Fedora 6 11-03-2005 10:59 AM
PHP5 to PHP4 on FC4? kz26 Fedora 5 10-24-2005 05:09 AM
Fc4+php5+mssql arenasa Fedora 2 09-21-2005 08:16 AM
Apache and PHP5 Mogatu Linux - Software 3 06-17-2005 03:43 PM
installing PHP4 and PHP5 on apache jerry_redhat Linux - Software 2 07-08-2003 10:27 PM


All times are GMT -5. The time now is 06:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration