PHP4 + OpenLDAP2 Build: Link Errors

From: Date: Wed, 13 Dec 2000 01:43:52 +0000
Subject: PHP4 + OpenLDAP2 Build: Link Errors
Groups: php.install 
Request: Send a blank email to php-install+get-1173@lists.php.net to get a copy of this message
Hello, I'm trying to build PHP with LDAP support, but I'm getting 'Undefined symbol' errors during the final link (when compiling a standalone PHP binary) or during apache invocation (when compiling PHP DSO-style). System configuration/versions: - Dell Dimension XPS R/400 (P2-400MHz) - Solaris 8 x86, with most recent patch clusters as of mid November - gcc 2.95.2 - gnu make 3.78.1 - standard Solaris ld, as, etc (in /usr/ccs/bin) - openldap 2.0.7 - gdbm 1.7.3 (used in openldap build) - php 4.0.3pl1 - apache 1.3.14 - LD_LIBRARY_PATH=/usr/local/bin Note that the version of apache is not directly relevant, as I have duplicated the link failure in the (simpler) case of building a standalone PHP binary. Build procedure, for standalone PHP binary: gdbm 1.7.3: $ cd <gdbm-build-dir> $ mkdir .log $ ./configure 2>&1 | tee .log/configure $ make 2>&1 | tee .log/make $ su # make install 2>&1 | tee .log/make_install openldap 2.0.7: $ cd <openldap-build-dir> $ mkdir .log $ ./configure 2>&1 | tee .log/configure $ make depend 2>&1 | tee .log/make_depend $ make 2>&1 | tee .log/make $ make test 2>&1 | tee .log/make_test <note that all tests completed successfully> $ su # make install 2>&1 | tee .log/make_install php 4.0.3pl1: $ cd <php-build-dir> $ mkdir .log $ ./configure --with-ldap 2>&1 | tee .log/configure $ make 2>&1 | tee .log/make The 'make' command for php works just fine, until the final link of the PHP binary, at which point I get numerous link errors on the ldap-related symbols. The last command issued by 'make', and the resulting output, are shown below: /bin/sh /home/op/inst/php-4.0.3pl1/libtool --silent --mode=link gcc -I. -I/home /op/inst/php-4.0.3pl1/ -I/home/op/inst/php-4.0.3pl1 -I/home/op/inst/php-4.0.3pl1 /main -I/home/op/inst/php-4.0.3pl1/Zend -I/home/op/inst/php-4.0.3pl1 -I/home/op/ inst/php-4.0.3pl1/ext/mysql/libmysql -I/home/op/inst/php-4.0.3pl1/ext/xml/expat/ xmltok -I/home/op/inst/php-4.0.3pl1/ext/xml/expat/xmlparse -I/home/op/inst/php-4 .0.3pl1/TSRM -D_POSIX_PTHREAD_SEMANTICS -DXML_BYTE_ORDER=12 -g -O2 -o php -ex port-dynamic stub.lo libphp4.la Undefined first referenced symbol in file ldap_count_values_len .libs/libphp4.a(ldap.o) ldap_get_dn .libs/libphp4.a(ldap.o) ldap_err2string .libs/libphp4.a(ldap.o) ldap_delete_s .libs/libphp4.a(ldap.o) ldap_first_entry .libs/libphp4.a(ldap.o) ldap_add_s .libs/libphp4.a(ldap.o) ldap_next_attribute .libs/libphp4.a(ldap.o) ldap_perror .libs/libphp4.a(ldap.o) ldap_get_option .libs/libphp4.a(ldap.o) ldap_value_free .libs/libphp4.a(ldap.o) ldap_explode_dn .libs/libphp4.a(ldap.o) ldap_get_values_len .libs/libphp4.a(ldap.o) ldap_search_s .libs/libphp4.a(ldap.o) ldap_modify_s .libs/libphp4.a(ldap.o) ldap_set_option .libs/libphp4.a(ldap.o) ldap_open .libs/libphp4.a(ldap.o) ldap_count_values .libs/libphp4.a(ldap.o) ldap_unbind_s .libs/libphp4.a(ldap.o) ldap_bind_s .libs/libphp4.a(ldap.o) ldap_msgfree .libs/libphp4.a(ldap.o) ldap_first_attribute .libs/libphp4.a(ldap.o) ldap_compare_s .libs/libphp4.a(ldap.o) ldap_value_free_len .libs/libphp4.a(ldap.o) ldap_dn2ufn .libs/libphp4.a(ldap.o) ldap_next_entry .libs/libphp4.a(ldap.o) ldap_get_values .libs/libphp4.a(ldap.o) ldap_count_entries .libs/libphp4.a(ldap.o) ld: fatal: Symbol referencing errors. No output written to php collect2: ld returned 1 exit status make[1]: *** [php] Error 1 make[1]: Leaving directory `/home/op/inst/php-4.0.3pl1' make: *** [all-recursive] Error 1 Now, the funny thing is, if I issue that final link command with '-lldap -llber' appended to it, I get a successful link, and a binary that appears to work correctly. So, it appears that one of three things is happening: A) The PHP configure/make system has a bug in it. B) I'm using the PHP configure/make system incorrectly. or C) I'm smoking too much crack. If any kind souls out there could offer their opinions on whether its A, B, or C, I'd appreciate it. I'd appreciate it even more if someone could offer help or advice, as long as it's either A or B ;) Thanks! Jason J Hinze jjh@cosmicflow.com

« previous php.install (#1173) next »