PHP 4.0 Bug #6650: ldap_add() working in PHP3, broken in PHP4
| From: | tengel at fluid dot com | Date: | Sun, 10 Sep 2000 19:56:09 +0000 |
| Subject: | PHP 4.0 Bug #6650: ldap_add() working in PHP3, broken in PHP4 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32833@lists.php.net to get a copy of this message | ||
From: tengel@fluid.com
Operating system: Solaris 2.7
PHP version: 4.0.2
PHP Bug Type: LDAP related
Bug description: ldap_add() working in PHP3, broken in PHP4
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