|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-10-12 11:05 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 01:00:02 2025 UTC |
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"