PHP 4.0 Bug #7099: ldap_add() under OpenLDAP 2.0.4+
| From: | malmond at vt dot edu | Date: | Mon, 09 Oct 2000 14:44:31 +0000 |
| Subject: | PHP 4.0 Bug #7099: ldap_add() under OpenLDAP 2.0.4+ | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34502@lists.php.net to get a copy of this message | ||
From: malmond@vt.edu
Operating system: Linux
PHP version: 4.0.2
PHP Bug Type: Unknown/Other Function
Bug description: ldap_add() under OpenLDAP 2.0.4+
I have been using OpenLDAP 1.2.11 for awhile and could add records to the LDAP from PHP; upon
switching into full production I can no longer add records (now using OpenLDAP 2.0.4). I have
recompiled PHP 4.0.2 with OL 2.0.4 and added to ld.so.conf the new path for the libs (ran ldconfig).
I can not add to LDAP. There are no problems with my schema or objectclasses; if I write the info
to file I can ldapadd from the command line no problem. I believe that it may have something to do
with simple authentication that is sometimes needed for OpenLDAP root (admin) account. If I
reinstall PHP, update ld.so.conf, this time pointing to OpenLDAP 1.2.11; the code works just fine in
adding the record. Code for both is as follows (code is abbreviated for this example):
$entry is the array of attributes
$dn the LDAP distinquished name (DN)
$ldap_link = ldap_connect("localhost");
if($ldap_link) {
if(ldap_bind($ldap_link, "uid=root,o=myorg,c=us","secretpassword")) {
if(ldap_add($ldap_link,$dn,$entry)) {
print "it worked";
} else {
print "did not work";
}
}
}
The script will always die on the ldap_add line: stating "LDAP: add operation could not be
completed"
--
Edit Bug report at: http://bugs.php.net/?id=7099&edit=1