|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6650 ldap_add() working in PHP3, broken in PHP4
Submitted: 2000-09-10 15:56 UTC Modified: 2000-10-29 00:11 UTC
From: tengel at fluid dot com Assigned: sniper (profile)
Status: Closed Package: LDAP related
PHP Version: 4.0.2 OS: Solaris 2.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: tengel at fluid dot com
New email:
PHP Version: OS:


 [2000-09-10 15:56 UTC] tengel at fluid dot com
Solaris 2.7, BerkelyDB 2.7.7, OpenLDAP 1.2.11, Apache 1.3.12.  A test script (below) when run with PHP4 (4.0.2) fails with a "Document contains no data"; it works perfectly fine in PHP3 (3.0.16).  Nothing is changed, simply change the Apache config file to enable 3 or 4 and test:

  $SERVER = "localhost";
  $ROOTDN = "cn=manager, dc=fluid, dc=com";
  if($ldap) {
    if(ldap_bind($ldap, $ROOTDN, $ROOTPW)) {
      $entry["cn"]="Test User";
      $dn="uid=tuser, ou=Employees, dc=fluid, dc=com";
      if(ldap_add($ldap, $dn, $entry)) {
        print("<H3>Entry Added!</H3>");
      } else {
        print("<H3>Add Failed!</H3>");
  } else {
    print("Connection Failed!");

Configuration params for all tools:

BerkleyDB 2.7.7:

OpenLDAP 1.2.11:
env \
  ac_cv_func_pthread_create=no ol_cv_kthread_flag=no \
  ol_cv_pthread_flag=no ol_cv_pthreads_flag=no \
  ol_cv_thread_flag=no \
  CPPFLAGS="-I/usr/local/BerkeleyDB/include" \
  LDFLAGS="-L/usr/local/BerkeleyDB/lib" \
  ./configure --with-ldbm-api=db2

Apache 1.3.12:
./configure \
  --with-layout=Apache \
  --prefix=/usr/local/dbdev/apache \
  --enable-module=most \

PHP 4.0.2
./configure \
  --enable-ftp \
  --disable-short-tags \
  --with-ldap=/usr/local \
  --with-apxs=/usr/local/dbdev/apache/bin/apxs \
  --with-oci8=/u01/app/oracle/product/8.1.6 \
  --with-exec-dir=/usr/local/dbdev/php/bin \
  --with-config-file-path=/usr/local/dbdev/php/lib \

The php.ini file used is the default php.ini-dist, it's never been touched.

Troy Engel


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-10 18:27 UTC]
I can't tell you exactly why it happens with PHP 4 and not 3, but I
think this is because Oracle 8.1.6 has an LDAP library conflicting
with the OpenLDAP one. You may want to try using the Oracle
library instead, simply use

 [2000-09-11 15:02 UTC] tengel at fluid dot com
Yes!  That worked (--with-ldap=/u01/app/oracle/product/8.1.6), it is now behaving normally.  Doing a "ldd" on and show that they're linked to different parts of my Oracle installation, so something changed in the linker chain in PHP4 to introduce this problem.

So, is this still considered a bug, or is it just one of those things for the FAQ/Knowledgebase?  It *seems* like I should be able to specify an alternate LDAP while compiling Oracle - I personally want to compile/link against OpenLDAP, as I plan on upgrading to the 2.0 release.

 [2000-10-29 00:11 UTC]
Fixed in CVS now.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC