PHP 4.0 Bug #6650 Updated: ldap_add() working in PHP3, broken in PHP4

From: Date: Sun, 10 Sep 2000 22:27:42 +0000
Subject: PHP 4.0 Bug #6650 Updated: ldap_add() working in PHP3, broken in PHP4
Groups: php.dev 
Request: Send a blank email to php-dev+get-32846@lists.php.net to get a copy of this message
ID: 6650 Updated by: venaas Reported By: tengel@fluid.com Status: Open Bug Type: LDAP related Assigned To: Comments: 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 --with-ldap=/u01/app/oracle/product/8.1.6 Previous Comments: --------------------------------------------------------------------------- [2000-09-10 15:56:09] tengel@fluid.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: <?php $SERVER = "localhost"; $ROOTDN = "cn=manager, dc=fluid, dc=com"; $ROOTPW = "[MY SECRET PASSWORD]"; $ldap=ldap_connect($SERVER); if($ldap) { if(ldap_bind($ldap, $ROOTDN, $ROOTPW)) { $entry["uid"]="tuser"; $entry["cn"]="Test User"; $entry["sn"]="User"; $entry["objectClass"]="person"; $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>"); $error=ldap_error($ldap); print("<BR>($error)"); } print("</body></html>"); } @ldap_close($ldap); } else { print("Connection Failed!"); $error=ldap_error($ldap); print("<BR>($error)"); } ?> Configuration params for all tools: BerkleyDB 2.7.7: ../dist/configure 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 --enable-shared=max 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 --with-db2=/usr/local/BerkeleyDB The php.ini file used is the default php.ini-dist, it's never been touched. -- Troy Engel tengel@fluid.com --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6650

« previous php.dev (#32846) next »