Might also try using TLS. In some configurations the LDAP server won't let you modify records unless you meet a minimum security requirement and sometimes this means encrypting the session. Try this:|
$ldap = ldap_connect("localhost");
trigger_error("Error attempting to start TLS: $e", E_USER_WARNING);
The above will fall back to unencrypted if TLS fails. Add an 'exit(1);' or some such if you'd rather have it abort.
And, as mentioned, you should be using a complete DN for your username, something like "cn=root,dc=mydomain,dc=tld".
The PHP-LDAP libraries are not the greatest (the ldap_start_tls function has no documentation BTW) but it mostly works well enough.
hope that helps,
On Mar 10, 2009, at 2:05 AM, Catalin wrote: