I've just started working on LDAP
and trying make an connection between PHP
& LDAP
.
I've created small script to get all attributes information by referring this script.
$ldap_server = "My_Server_Name";
$ldap_user = "uid=platypus,ou=users,dc=crowd";
$ldap_pass = "My_Password";
$ad = ldap_connect($ldap_server);
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
$bound = ldap_bind($ad, $ldap_user, $ldap_pass);
$result = ldap_read($ad, $ldap_user, "objectClass=*");
$attributes = ldap_get_attributes($ad, $result);
echo "<pre>";
print_r($attributes);
Connection is successfully made, its binding properly as well and ldap_read
also giving me #resourse id
but ldap_get_attributes
giving me following error:
PHP Warning – yii\base\ErrorException ldap_get_attributes(): supplied resource is not a valid ldap result entry resource
Any help would be appreciated.
Thanks