php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7099 ldap_add() under OpenLDAP 2.0.4+
Submitted: 2000-10-09 10:44 UTC Modified: 2000-10-12 11:05 UTC
From: malmond at vt dot edu Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.2 OS: Linux
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: malmond at vt dot edu
New email:
PHP Version: OS:

 

 [2000-10-09 10:44 UTC] malmond at vt dot edu
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"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-12 11:05 UTC] sniper@php.net
User reported problem solved.

--Jani

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 19 00:01:29 2025 UTC