是否可以(我正在尝试)通过 php 连接到 Mac OS X 10.6 服务器?我的 LDAP 服务正在运行。
这是我尝试过的:
// using ldap bind
$ldaprdn = 'diradmin'; // ldap rdn or dn
$ldappass = 'password'; // associated password
// connect to ldap server
$ldapconn = ldap_connect("server.example.com")
or die("Could not connect to LDAP server.");
ldap_set_option( $ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3 );
if ($ldapconn) {
// binding to ldap server
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
// verify binding
if ($ldapbind) {
echo "LDAP bind successful...";
} else {
echo "LDAP bind failed...";
}
}
错误消息:消息:ldap_bind():无法绑定到服务器:DN 语法无效