Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: httpd: fatal: relocation error:

Posted on 2009-04-23
Medium Priority
Last Modified: 2013-12-13

I am installing PHP 2.2.9 on SUN Solaris 10 with apache 2.2.9 and perl 5.8.8.
Everything seems to be good unless PHP Configuration.
I did those commands below :
./configure --with-oracle=/u01/app/product/10203
--prefix /usr/local
make install

I did'nt have any fatal error message until the end.
But I get error this messge error when trying to start apache :

httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: httpd: fatal: relocation error: file /usr/local/apache2/modules/libphp5.so: symbol xmlTextReaderSetup: referenced symbol not found

I've installed libxml2 yet.
Can you help me to find ?

Thanks for tour reply
Question by:papfal
  • 3
  • 3

Expert Comment

ID: 24230556
at line 55 of this file:

you have something like the following entry:
LoadModule php5_module        modules/libphp5.so

the problem is that this file wasn't installed: libphp5.so.

Try locating that file using the following command at the terminal: "locate libphp5.so". you may need to run updatedb first. it should be somewhere in /usr/local/apache2. If you find it, move it to /usr/local/apache2/modules/

also, did you install apache before you installed php? If you didn't, then that would explain the error too. You may need to just reinstall php using the same commands as before. actually, it should even work just by typing make install in the php source directory


Author Comment

ID: 24235775
Thanks for your reply.
But the file libphp5.so is already in the /usr/local/apache2/modules/ directory.
I installed apache before php and wonder where is the problem.
I did the same installation on the same server with the same configuration and everything was ok.
Can you help me ?

Expert Comment

ID: 24237433
sorry, i misread the error message. here's the crucial info: symbol xmlTextReaderSetup: referenced symbol not found

looks to me like your php was compiled fine but your LD_LIBRARY_PATH environment variable isn't being properly set. In the script you use to start apache (most likely /usr/local/apache2.bin/apachectl), add a line to specify the LD_LIBRARY_PATH environment variable near the top. it should look something like this..

export LD_LIBRARY_PATH="/usr/local/lib/"

where /usr/local/lib should be the path to your libxml2.so files. If you're not sure where that is, run the command "ldd /usr/local/apache2/modules/libphp5.so" and one of the entries should look something like this:

libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0xb7397000)

the path should be pretty apparent to you.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 24239960

You're right my libxml configuration was pretty good unless my PATH. Look at the ldd command :
[/c102/users/<users>] ldd /usr/local/apache2/modules/libphp5.so
        librt.so.1 =>    /usr/lib//librt.so.1
        libsybdb.so.5 =>         /usr/local/lib/libsybdb.so.5
        libresolv.so.2 =>        /usr/lib//libresolv.so.2
        libm.so.2 =>     /usr/lib//libm.so.2
        libnsl.so.1 =>   /usr/lib//libnsl.so.1
        libsocket.so.1 =>        /usr/lib//libsocket.so.1
        libz.so =>       /usr/local/lib/libz.so
        libkstat.so.1 =>         /usr/lib//libkstat.so.1
        libgen.so.1 =>   /usr/lib//libgen.so.1
        libdl.so.1 =>    /usr/lib//libdl.so.1
        libsched.so.1 =>         /usr/lib//libsched.so.1
        libclntsh.so.10.1 =>     /u01/app/oracle/product/10203//lib32/libclntsh.so.10.1
        libxml2.so.2 =>  /usr/local/lib/libxml2.so.2
        libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
        libc.so.1 =>     /usr/lib//libc.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libaio.so.1 =>   /usr/lib//libaio.so.1
        libmd.so.1 =>    /usr/lib//libmd.so.1
        libmp.so.2 =>    /usr/lib//libmp.so.2
        libscf.so.1 =>   /usr/lib//libscf.so.1
        libnnz10.so =>   /u01/app/oracle/product/10203/lib32/libnnz10.so
        libm.so.1 =>     /usr/lib//libm.so.1
        libpthread.so.1 =>       /usr/lib//libpthread.so.1
        libdoor.so.1 =>  /usr/lib//libdoor.so.1
        libuutil.so.1 =>         /usr/lib//libuutil.so.1

I had the libxml in two directories /usr/local/lib/libxml2.so.2 and /usr/lib/libxml2.so.2.
Apache was looking at the wrong one. So I rename the library under usr/lib and evrything run ok.
Thank you for your help.

But I m having another problem. I cant bring my php pages in the browser when I do http://<server name>. I have apache running ok and only directories displayed. Have you any idea where is my problem ?

Thanks for your feedback

Accepted Solution

majikman earned 1500 total points
ID: 24240074
Thats probably because you're not accessing the file via the absolute path. Also, you should make sure that the file's file extension matches whatever you have for the DirectoryIndex directive in your httpd.conf config file.

Author Comment

ID: 24240964
Actually the name of my index page was wrong. I rename it and evrything goes good.
Thank to you for your help

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month17 days, 13 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question