подключение к серверу LDAP с помощью php

Я хочу подключиться к серверу LDAP, чтобы получить список OU, используя php.

    $ldaphost = "ldap://192.168.10.10";
    $ldapUsername  = "ldap_user";
    $ldapPassword = "xxxxxxxx";

    $ds = ldap_connect($ldaphost);

    if(!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)){
        print "Could not set LDAPv3\r\n";
    }
    else if (!ldap_start_tls($ds)) {
        print "Could not start secure TLS connection";
    } 
    else {
    // binding to the ldap server
        $bth = ldap_bind($ds, $ldapUsername, $ldapPassword) or die("\r\nCould not connect to LDAP server\r\n");
    }

После запуска кода я получаю следующую ошибку:

LDAP_START_TLS(): UNABLE TO START TLS: SERVER IS UNAVAILABLE

Я не знаю, что-то не так с моим кодом или проблема с конфигурацией сервера!? Однако я мог подключиться к серверу через AdExplorer с тем же именем пользователя и паролем LDAP.


person Hamid Ghorashi    schedule 29.11.2015    source источник
comment
Другой: заголовок stackoverflow.com/questions/2689629/   -  person Alexander O'Mara    schedule 29.11.2015
comment
Еще один: stackoverflow.com/questions/16817876/   -  person Alexander O'Mara    schedule 29.11.2015