this options worked for me, without that i got fai...
# troubleshooting
x
this options worked for me, without that i got failed connect to LDAP server
Copy code
<?php

$ldapuri = "ldap://192.168.0.2:3890";
$ldap_dn = "uid=readonly,ou=people,dc=example,dc=com";
$ldap_password = "ldapreadonly";

$ldapconn = ldap_connect($ldapuri)
          or die("That LDAP-URI was not parseable");

ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);

 if ($ldapconn) {
            // binding to ldap server
            $ldapbind = ldap_bind($ldapconn, $ldap_dn, $ldap_password);
            // verify binding
            if ($ldapbind) {
                echo "LDAP bind successful...\n";
            } else {
                echo "LDAP bind failed...\n";
            }

    }

ldap_close($ldapconn)

?>