免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1637 | 回复: 8
打印 上一主题 下一主题

[ldap] 为什么啊?????? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-07-20 17:12 |只看该作者 |倒序浏览
Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in d:\greenamp\www\cmailnet\test.php on line 7

论坛徽章:
0
2 [报告]
发表于 2005-07-20 17:39 |只看该作者

为什么啊??????

At the server end, run slapd in max. debugging mode:

# /path/to/slapd -d -1 -u ldap

论坛徽章:
0
3 [报告]
发表于 2005-07-20 17:55 |只看该作者

为什么啊??????

What's wrong? =>; PHP script? or LDAP slapd?
firstly test your ldap! running or death ?

$ telnet your.ldap.host ldap

or

$ ldapsearch -x -h your.ldap.host

if ldap running, is the error from PHP! otherwise
check more slapd.

论坛徽章:
0
4 [报告]
发表于 2005-07-20 18:01 |只看该作者

为什么啊??????

i am using winxp not linux, then...

论坛徽章:
0
5 [报告]
发表于 2005-07-20 18:04 |只看该作者

为什么啊??????

i tested
my ldap's path is
greenamp/openldap/
i in this fold key in .\slapd -d 256 then i saw "slapd starting"
is it means the ldap server has been powered on???

论坛徽章:
0
6 [报告]
发表于 2005-07-20 18:36 |只看该作者

为什么啊??????

i key in "telnet localhost 389" when i powered on openldap
it works!
but the problem"Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in d:\greenamp\www\cmailnet\test.php on line 7" existed also

论坛徽章:
0
7 [报告]
发表于 2005-07-20 18:51 |只看该作者

为什么啊??????

好象是php 不支持ldapv3协议的说!!

论坛徽章:
0
8 [报告]
发表于 2005-07-20 19:01 |只看该作者

为什么啊??????

i have resolve this problem
look my program


<?
$ds=ldap_connect("localhost","389"
        or die("Could not connect ldap";
               
if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
    echo "Using LDAPv3<br>;";
} else {
    echo "Failed to set protocol version to 3<br>;";
}

    $r=ldap_bind($ds);   
    echo "Bind result is ".$r."<br />;";
?>;

in php manuel i found if the version of openldap >;2 the php will have some problem on ldap_bind(); because php try to use ldapv2 to bind, but the >;2 version openldap use ldapv3.
so you must key in:
  if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
    echo "Using LDAPv3<br>;";
} else {
    echo "Failed to set protocol version to 3<br>;";
}

论坛徽章:
0
9 [报告]
发表于 2005-07-21 12:27 |只看该作者

为什么啊??????

It is ALWAYS a good idea to add this directive to slapd.conf so that OpenLDAP could answer BOTH v2 or v3 connection requests.

allow bind_v2 bind_anon_dn

Gary
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP