PHP Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server

前端 未结 4 639
既然无缘
既然无缘 2021-01-11 19:26

I\'ve following problem with my php script:

PHP Warning: ldap_bind(): Unable to bind to server: Can\'t contact LDAP server in ....

4条回答
  •  耶瑟儿~
    2021-01-11 19:55

    the ldap_bind() function asks for a three parameters:

    1. a resource id
    2. a rdn
    3. a password associated with the rdn the rdn and password are optional

    if you bind using only the resource id :-

    // $ldap=ladap_connect(*hostname*,*port*);  
    // ldap_connect() returns a resource id
    ldap_bind() returns a boolean value(true or false)  
    ldap_bind($ladp); //annonymous bind    
    $lb=ldap_bind($ldap,"uid=xxx,ou=something,o=hostname.com","password"); //used to authenticate  
    

    this should work if not then you are using invalid credentials.

提交回复
热议问题