I installed open ldap Version 2.0 on Redhat Linux Version 7.0 I can bind to the ldap directory but I cannot add records. I'm getting the following error message:
Warning: LDAP: add operation could not be completed. in /var/www/html/www/ldap/ldap.php on line 69
Below is what my PHP code looks like:
$ds=ldap_connect("172.16.11.10");
$dn = "cn=Manager, o=api_group";
if ($ds) {
// bind with appropriate dn to give update access
$r=ldap_bind($ds,$dn, "password");
$info["cn"]="John Jones";
$info["sn"]="Jones";
$info["mail"]="jonj@here.and.now";
$info["objectclass"]="top";
// add data to directory
$r=ldap_add($ds, "cn=John Jones, o=api_group", $info);
ldap_close($ds);
} else {
echo "Unable to connect to LDAP server";
}
?>
I've read some help files on the internet but I am still kind of confused as to how ldap works. I wonder if my problem has to do with the object class? I don't know if it should be "top".
Do I need to add top as an object class? If so, how do I go about doing that?
Thanks,
Jamie