Link to home
Start Free TrialLog in
Avatar of Seydina Fall
Seydina Fall

asked on

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

Hi,

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
--with-oci8=/u01/app/oracle/product/10203
--prefix /usr/local
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mssql=/usr/local
make
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
Avatar of majikman
majikman

at line 55 of this file:
/usr/local/apache2/conf/httpd.conf,

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

Avatar of Seydina Fall

ASKER

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 ?
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.
Thanks

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
        /platform/SUNW,Sun-Fire-V445/lib/libc_psr.so.1
        /platform/SUNW,Sun-Fire-V445/lib/libmd_psr.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
ASKER CERTIFIED SOLUTION
Avatar of majikman
majikman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually the name of my index page was wrong. I rename it and evrything goes good.
Thank to you for your help