View Full Version : Error: Cannot load libphp5.so to server in Apache and PHP

5th November 2005, 11:42 PM
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 have tried restorecon, chcon, and even tried chmod 777 commands to no avail.

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.

6th November 2005, 11:51 PM
Why is php shared object in /www/libexec ? On my system it's in /usr/lib/httpd/modules, together with all the other shared objects...

7th November 2005, 03:11 AM
thanks for your reply. i did not do an rpm install on my applications. i did it manually. any idea why its giving the error message? thanks again!

7th November 2005, 03:25 AM
Well, the fact that it prints out Permission denied makes me think it's related to the fact that normal libraries sit into a root-owned tree readable by all (/usr/lib:/usr/local/lib:etc). If the libraries sit in the http tree, there may be a problem in the way permissions are set, leading to some processes started by the web server not being able to read their respective libraries.

7th November 2005, 07:39 AM
i was following this book about setting up lamp. everything is working well up to the mysql installation. it's only the php that's causing the problem. i configured apache to have a prefix = /www. i don't know what happened. please help.

7th November 2005, 12:37 PM
Is SELinux enabled on your system ? If so, disable it and try again.

7th November 2005, 07:22 PM
hi... im not sure how to disable selinux. i even have no idea what it does. could you please explain to me what to do? thanks!!!

8th November 2005, 12:54 PM
Not sure, as I don't use it, but from a quick search this is what I found: to disable it

echo "0" >/selinux/enforce

to re-enable it

echo "1" >/selinux/enforce

or use the command


To check whether it is enabled, you can give the following command

selinuxenabled && echo "SELinux is enabled"

If it prints the string "SELinux is enabled", it is enabled; if it prints nothing, it's not enabled.
To disable it completely, you have to pass the following parameter to the kernel:


But check this last option before actually implementing it, since (from what I read) it may bring undesired consequences.


14th November 2005, 03:36 AM
hi giulix,
thanks for all your help / suggestions. i was going to disable selinux but backedoff and got scared of the risk it may create. so i decided to install my apache, mysql, php using the fast way....rpms. everything works. no errors. it was actually kinda fun configuring it manually but the errors slowed me down. learned a lot from it though thru you guys. now my problem is how to remove or uninstall the ones i previously loaded. any idea?

8th November 2006, 12:45 AM
I had the same problem (most likely we are reading the same book ;)) on FC6. It seems to be an issue realting to the SELinux configuration as suggested above.

Just type "setenforce 0" and you can start the server. You can type "setenforce 1" afterwards if you like.

If anyone has tips on how to correctly configure SELinux to avoid this issue entirely that would be helpful (I myself am not very familiar with Linux at this point in time).