LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-04-2011, 02:39 AM   #1
bilal_mld
LQ Newbie
 
Registered: Jun 2010
Posts: 13

Rep: Reputation: 0
Unhappy Apache starting error after installing PHP (reloc: Permission denied)


I am running RedHat 5.1 server. I installed apache version(httpd-2.2.3-11.el5). I also installed php-5.3.4 with source code , before installing php on my server my apache was running smoothly, but after the installation of php , apache was not starting.

I used the following commands to check httpd.conf file.

1. httpd -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c

2. httpd -v
Server version: Apache/2.2.3
Server built: Aug 6 2007 07:21:45

3. httpd -S

httpd: Syntax error on line 207 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib/httpd/modules/libphp5.so into server: /usr/lib/httpd/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied

4. httpd -M
httpd: Syntax error on line 207 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib/httpd/modules/libphp5.so into server: /usr/lib/httpd/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied

5. httpd -t
httpd: Syntax error on line 207 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib/httpd/modules/libphp5.so into server: /usr/lib/httpd/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied



Disabling the SELinux makes apache to run but when i set it into Enforcing mode again apache stops working and the above Permission denied error occurs.

Please anyone provide me the solution with out compromising my security issues.
 
Old 01-04-2011, 03:00 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,526

Rep: Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503
Hi,

You can use:
Code:
chcon -t texrel_shlib_t /usr/lib/httpd/modules/libphp5.so
Regards
 
Old 01-05-2011, 01:51 AM   #3
bilal_mld
LQ Newbie
 
Registered: Jun 2010
Posts: 13

Original Poster
Rep: Reputation: 0
My SELinux context is already set as you told.. but still the same error is occurring...


ll -Z /usr/lib/httpd/modules/libphp5.so
-rwxr-xr-x root root system_ubject_r:textrel_shlib_t /usr/lib/httpd/modules/libphp5.so

plz. try to solve it...
 
Old 01-05-2011, 04:13 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,526

Rep: Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503
This is the usual way to resolve this SELinux problem.
If it doesn't work for your case, you might try the 2nd solution here

Or you can remove the compiled php and use this php package
 
  


Reply


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
apache - permission denied - error log m3phisto Linux - Server 17 03-04-2010 09:07 AM
permission denied error in php socket programming jayasekar Linux - Software 1 01-21-2010 07:04 AM
cannot restore segment prot after reloc: Permission denied HarryBoy Linux - Newbie 1 11-25-2009 08:11 AM
Acroread: libJP2K.so: cannot restore segment prot after reloc: Permission denied pavodive Linux - Security 8 02-25-2009 02:52 PM
I have an apache problem Starting httpd: (13)Permission denied: make_sock: could not LinuxCrazy Linux - Server 1 06-24-2007 06:24 PM


All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration