Unable to bind to server: Can't contact LDAP server in D:\etim_server\etim_11\we

xjwchy 2011-10-30 06:18:49
高人们 帮忙
我用 ladp_bind的时候出这个错误啊.ladp_connect没有问题
...全文
443 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq5005952 2011-12-07
  • 打赏
  • 举报
回复
主机环境配置说明:

openldap-2.2.29 / db-4.3.29 / openssl-0.9.8a

代码:

<?php

$ldap_host="ldap://10.14.2.59";
$ldap_port="389";
$ldap_dn="cn=admin,dc=miracle,dc=com";
$ldap_pwd="miracle";
$ldap_conn=ldap_connect($ldap_host,$ldap_port)or die("LDAP connection failed");
ldap_bind($ldap_conn,$ldap_dn,$ldap_pwd)or die("LDAP bind failed");
ldap_unbind($ldap_conn)or die("LDAP unbind failed");

?>

错误:

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Protocol error in D:\AppServ\www\others\ldap\index.php on line 16
LDAP bind failed

解决:在slapd.conf 最后加一句:allow bind_v2

原因(据openldap官网):

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.

xjwchy 2011-11-02
  • 打赏
  • 举报
回复
谢谢各位
解决了
dns配置错误
www_7di_net 2011-10-31
  • 打赏
  • 举报
回复
你在你的php.ini中把php_ldap的函数dll前面的注释';'去掉就可以了.

可参阅
http://bbs.chinaunix.net/thread-499482-2-1.html
xinjian555 2011-10-31
  • 打赏
  • 举报
回复
很可能是连接不上LDAP服务器,

wuqiang1123 2011-10-31
  • 打赏
  • 举报
回复
在php 里
extension=php_ldap.dll 后面分号去掉

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧