LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 11-05-2005, 02:33 PM   #1
jun_tuko
Member
 
Registered: Oct 2005
Location: Seattle, WA
Distribution: Fedora Core 4
Posts: 67

Rep: Reputation: 15
Error in PHP 5.0.5 and Apache 1.3.34 - Cannot load libphp5.so


hello gurus!!
i need your help once again. i just installed apache, mysql, and php. after i installed php and tried to run apache, i get this error:

[root@projectff conf]# 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

line 221 in my httpd.conf states:
LoadModule php5_module libexec/libphp5.so

i have read similar thread like mine but i can't find the fix for this.

i am logged in as root and looked at the file /www/libexec/libphp5.so's permission. it has 755 on it. it is owned by root.

i am using: fedora core 4
installed: apache 1.3.34, mysql-5.0.15, and php-5.0.5.

anybody pls. help. thanks in advance.

Last edited by jun_tuko; 11-05-2005 at 02:39 PM.
 
Old 11-06-2005, 11:13 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
It may be that the versions of Apache and PHP are so far apart, there are problems loading the lib. PHP5 is rather new (still in development, not mainstream yet I thought?) whereas Apache 1.3.x is fairly old school, Apache2.x has been considered stable for quite some time.

How did you install the applications, and if via RPM, where did you get the RPM's?

Cool
 
Old 11-07-2005, 01:01 AM   #3
jun_tuko
Member
 
Registered: Oct 2005
Location: Seattle, WA
Distribution: Fedora Core 4
Posts: 67

Original Poster
Rep: Reputation: 15
hello mc,
thanks for your reply. i am following this book about setting up lamp. they suggested to use apache 1.3 instead of apache 2 due to its stability. on php however, they suggested to use 5, due to its updated fixes. i have tried installing php 4 but same result. i am thinking of installing apache 2 with php 5, then apache 2 with php 4 if the previous does not work. i have another question for you: how do you uninstall an application? do you just write over it?

below are my steps for apache and php. i have them on scripts:

for apache:
cd /usr/local/src/webserver/apache_1.3.34
make distclean
./configure \
--prefix=/www \
--enable-module=so \
--enable-module=rewrite \
--enable-shared=rewrite \
--enable-module=setenvif \
--enable-shared=setenvif \
--enable-module=mime \
--enable-shared=mime \
--enable-module=mime_magic \
--enable-shared=mime_magic \
--enable-module=dir \
--enable-shared=dir \
--enable-module=auth \
--enable-shared=auth \
--enable-module=access \
--enable-shared=access \
--enable-module=alias \
--enable-shared=alias \
--enable-module=status \
--enable-shared=status \
--enable-module=userdir \
--enable-shared=userdir \
--enable-module=vhost_alias \
--enable-shared=vhost_alias \
--enable-module=env \
--enable-shared=env \
--enable-module=log_referer \
--enable-shared=log_referer \
--enable-module=log_config \
--enable-shared=log_config \
--enable-module=log_agent \
--enable-shared=log_agent \
--enable-module=headers \
--enable-shared=headers \
--enable-shared=max \
--enable-rule=SHARED_CORE

*****the last 2 lines i added in. it came from a php site suggestion in solving cannot load lib errors.

for php:
cd php-5.0.5
./configure \
--with-apxs=/www/bin/apxs \
--with-mysql=/usr/local/mysql \
--enable-ftp \
--enable-trans-sid

i ran makes and make installs after the configure. any suggestion?

thanks!
 
Old 03-23-2007, 11:29 PM   #4
rlee923
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 6
Posts: 88

Rep: Reputation: 17
here's the code to fix the problem

chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so
 
Old 11-01-2007, 08:24 PM   #5
evilspro
LQ Newbie
 
Registered: Nov 2007
Posts: 1

Rep: Reputation: 0
thank you very much
 
Old 01-02-2008, 08:32 PM   #6
xsqian
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 0
chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so

Quote:
Originally Posted by rlee923 View Post
chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so
Thank you so much for the post. The fix resolved my issue.
Actaully do you mind explain what does this "chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so" do and how does this resolve the issue?

Thanks,
xsqian
 
Old 01-05-2008, 04:18 AM   #7
rlee923
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 6
Posts: 88

Rep: Reputation: 17
Hm.. good point.

Which means I do not know 100%.

What really happens is that SELinux security model blocks the access to certain parts and I am guessing libphp.so module of the apache is blocked by this.
So the command that I have found alters so php module is included into either exception or different group which receives proper access granted so apache server includes php module.

I did try to figure out a bit, but it is very complicated as you have understand SELinux.
So I gave up at a certain point.

It is not just a list of exceptions for certain program. The first thing I saw was understanding the state transitions so I didn't want to go to deep that this stage.

Last edited by rlee923; 01-05-2008 at 04:21 AM.
 
1 members found this post helpful.
Old 01-05-2008, 11:12 PM   #8
xsqian
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 0
Error in PHP 5.0.5 and Apache 1.3.34 - Cannot load libphp5.so

Thanks for the effort to explain!
 
  


Reply



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
Cannot load /usr/lib/apache2/libphp5.so into server Kristijan Slackware 1 10-08-2005 12:28 AM
FreeBSD PHP5 ports error - libphp5.la is not a valid libtool archive BizHat.com *BSD 2 08-18-2005 10:27 AM
configuring apache to load with php support jomy Linux - Networking 1 03-06-2005 08:38 AM
Server load code Apache+PHP mindfrost82 Linux - Software 1 01-03-2005 10:43 AM
Can't load php module in Apache pepino Linux - Newbie 2 10-21-2003 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:46 PM.

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
Open Source Consulting | Domain Registration