Windows installed ldap and test basic tutorial

  

Download openldap2.2.29.rar, and all the way down.

Then, according to the online configuration slapd.conf:

In the include./schema/core.schema line, add

include ./schema/cosine.schemainclude ./schema /inetorgperson.schemainclude ./schema/nis.schemainclude ./schema/misc.schema

Then test with php, the test code is:

<?php//ldap service address $ldap_host = "ldap://127.0.0.1";//ldap service occupies port $ldap_port = 389; //link ldap server $ldap_conn = ldap_connect($ldap_host, $ldap_port) or die("Can not connect LDAP server .");//Administrator login name $rootdn = 'cn=Manager,dc=my-domain,dc=com';//Password $rootpw = 'secret';//bind user ldap_bind($ldap_conn, $rootdn, $rootpw) ;//or die("Can not binding to LDAP server.");var_dump($ldap_conn);

?>

But the prompt:< Br>

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Protocol error in D:\\virtual\\test.php on line 14resource(2) of type (ldap link)

There is a solution found on the Internet:

Add one sentence to slapd.conf: all Ow bind_v2

Cause (according to openldap official website):

OpenLDAP Software does not support LDAPv2 (now historic). OpenLDAP 2.x's slapd(8) can be configured to accept a version 2 LDAP Bind Request, but expects requesting version 2 to speak a restricted, non-standard variant for LDAPv3 (basically LDAPv3 syntaxes and semantics in LDAPv2 PDUs). To enable this, place the following in your slapd.conf(5) file.

After adding the OpenLDAP Directory Service after joining, it is normal.

Copyright © Windows knowledge All Rights Reserved