php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6072 ldap library missing from libphp4.so - shows up when apache is started.
Submitted: 2000-08-10 08:03 UTC Modified: 2000-10-15 18:51 UTC
From: karen dot turner at opus dot co dot nz Assigned: sniper (profile)
Status: Closed Package: *General Issues
PHP Version: 4.0.1pl2 OS: Solaris 2.6
Private report: No CVE-ID: None
 [2000-08-10 08:03 UTC] karen dot turner at opus dot co dot nz
When starting apache I got the following error.  It turns out the ldap
library is not being linked in - the ldd output below shows this. The ldap
library is missing from the .la files - again shown below.

I can't work out how to fix it - work around is to load the php3 module as
well.

Starting the Apache Web Server.
Syntax error on line 228 of /opt/serv/etc/httpd.conf:
Cannot load /opt/serv/libexec/libphp4.so into server: ld.so.1: /opt/serv/sbin/httpd: fatal: relocation error: file /opt/serv/libexec/libphp4.so: symbol ldap_unbind_s: referenced symbol not found
Segmentation Fault

I use 

./configure --with-apxs=/opt/serv/sbin/apxs --enable-versioning --with-mysql=/opt/mysql --prefix=/opt/php --with-exec-dir=/opt/serv/libexec/ --with-db2 --with-gd  --with-ttf=/opt/serv --with-ldap=/opt/serv --with-zlib=/opt/gnu --with-pgsql=/opt/serv --enable-sysvsem --enable-sysvshm --with-yp --enable-ftp --with-config-file-path=/opt/php/etc --with-gdbm=/opt/gnu

However when it is loaded into apache the ldap library is missing. ldd
shows that it is not referenced in libphp4.so.

 ldd libphp4.so
        libgdbm.so =>    /opt/gnu/lib/libgdbm.so
        libpam.so.1 =>   /usr/dt/lib/libpam.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libz.so =>       /opt/gnu/lib/libz.so
        libpq.so =>      /opt/serv/lib/libpq.so
        libmysqlclient.so.6 =>   (file not found)
        libttf.so.2 =>   /opt/serv/lib/libttf.so.2
        libgd.so =>      /opt/serv/lib/libgd.so
        libpng.so.2 =>   /opt/serv/lib/libpng.so.2
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libm.so.1 =>     /usr/lib/libm.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2

When I checked the libphp4.la file it was missing from there - which
explains why ldd doesn't find it.

portion of libphp4.la file ahoinf rhw miaainf ldap library:
....
# Libraries that this one depends upon.
dependency_libs=' -R/usr/ucblib -R/opt/gnu/lib -R/usr/local/lib -R/opt/serv/lib -R/opt/mysql/lib/mysql  -L/usr/ucblib -L/opt/gnu/lib -L/usr/local/lib -L/opt/serv/lib -L/opt/mysql/lib/mysql -lgdbm -lpam -ldl -lz -lpq -lmysqlclient -lttf -lgd -lpng -ldb -lgdbm -lresolv -lresolv -lm -ldl -lcrypt -lnsl -lsocket -lsocket -lgdbm -lpam -ldl -lz -lpq -lmysqlclient -lttf -lgd -lpng -ldb -lgdbm -lresolv -lresolv -lm -ldl -lcrypt -lnsl -lsocket -lsocket'

# Version information for libphp4.
....


I wasn't sure how to get this added.  I noticed that it was missing from
the Makefile in Zend.

libZend_la_LDFLAGS =  -lgdbm -lpam  -ldl -lz -lpq -lmysqlclient -lttf -lgd -lpng
 -ldb -lgdbm -lresolv -lresolv -lm -ldl -lcrypt -lnsl -lsocket  -lsocket

I didn't notice the problem until I stopped loading the php3 library into
apache.

I tried building without --enable-versioning, however the problem still
remained.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-11 05:53 UTC] sniper@php.net
Which ldap-library do you use? And where is it located?
Is there any warnings / errors in config.log related to
ldap??

--Jani
 [2000-08-13 17:43 UTC] karen dot turner at opus dot co dot nz
The ldap library is in /opt/serv/lib/libldap.so.1 version Openldap 1.2.7.

There are no warnings about LDAP in the config.log.

I should also note that with the configure options I have given I also came across #6070 - where configure missed adding the png library.  I made one change to the configure scipt as noted in that bug report: LIBS="-lgd $LIBS changed to LIBS="-lgd -lpng $LIBS.
 [2000-08-13 19:49 UTC] sniper@php.net
Delete config.cache and do a re-configure using only
--with-apxs and --with-ldap (with the proper paths of course)

If it works, try adding more options one by one and see where the
configure / compile / starting httpd starts to fail.

And of course you should update your openldap-libraries. There are a few
bugs in 1.2.7.

--Jani

 [2000-08-13 20:01 UTC] karen dot turner at opus dot co dot nz
The ldap library is in /opt/serv/lib/libldap.so.1 version Openldap 1.2.7.

There are no warnings about LDAP in the config.log.

I should also note that with the configure options I have given I also came across #6070 - where configure missed adding the png library.  I made one change to the configure scipt as noted in that bug report: LIBS="-lgd $LIBS changed to LIBS="-lgd -lpng $LIBS.
 [2000-08-14 18:50 UTC] karen dot turner at opus dot co dot nz
Hi

I have just untarred php src and re-built using

 ./configure --with-apxs=/opt/serv/sbin/apxs --with-ldap=/opt/serv

The ldap library is still missed.

 ldd libphp4.so
        libgdbm.so =>    /opt/gnu/lib/libgdbm.so
        libpam.so.1 =>   /usr/dt/lib/libpam.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libm.so.1 =>     /usr/lib/libm.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2

Starting the Apache Web Server.
Syntax error on line 228 of /opt/serv/etc/httpd.conf:
Cannot load /opt/serv/libexec/libphp4.so into server: ld.so.1: /opt/serv/sbin/httpd: fatal: relocation error: file /opt/serv/libexec/libphp4.so: symbol ldap_unbind_s: referenced symbol not found


Ldap is still missing from libs/libphp4.la
I was trying to work out at what point the ldap library was being missed.  Which was how I noticed it was missing from the la file, where as mysql etc were listed.   But I wasn't quite sure of where it should be appearing and at what point it had gone missing.

My version of ldap will be upgraded hopefully soon.

Thanks 
  Karen
 [2000-08-15 04:06 UTC] sniper@php.net
If I have understood ext/ldap/config.m4 correctly it's
only looking for the static libraries of openldap. 

Are these files in /opt/serv/lib :

libldap.a
liblber.a

Are these files in /opt/serv/include :

lber.h  
ldap.h  
ldap_cdefs.h

??

If any of those are missing your openldap-install is broken.

--Jani
 [2000-08-16 19:25 UTC] karen dot turner at opus dot co dot nz
Thank you for pointing me at the m4 file.  It is only looking for the static library.

I have no libldap.a or libber.a - which is strange. Unfortunatly I didn't do the build of Openldap and the person who did has left.  It will be updated shortly.

I don't beleive it is broken though - PHP3 uses it quite happily.  Solaris does rely a lot on dynamic libraries.

I didn't want to try rerunning autoconf - never having done it and I wasn't sure if I had all the bits.  So I edited  configure itself changing 

	if test -f $LDAP_LIBDIR/liblber.a; then
		LDAP_LIBS="-lldap -llber"
to
	if test -f $LDAP_LIBDIR/liblber.a -o -f $LDAP_LIBDIR/liblber.so ; then
		LDAP_LIBS="-lldap -llber"

This worked - apache started up fine. Ldd showed both ldap and lber libraries.

Is there some reason that the m4 file only looks for the static library?

Karen

 [2000-10-15 18:51 UTC] sniper@php.net
Fixed in CVS.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 21:01:30 2024 UTC