douxiegan6468 2014-11-06 13:37
浏览 389

PHP ldap_bind():无法绑定到服务器:凭据无效

I'm connecting ldap server in my local system to server. It is successfully connected but the thing is while connecting from other server ex: B server to A server i got error like this invalid credential.

$username='ZZZ.YYY';
$domain='test';
$host='ldap://AAA.test.org';
$password='XXXX';
$port=389;
$ldapconn = ldap_connect($host, $port)
or die("Could not conenct to {$host}");
if ($ldapconn) {

$bind=ldap_bind($ldapconn, $username .'@' .$domain, $password);
if ($bind) {
    echo("Login correct");
} else {
    echo("Login incorrect");
}

}
ldap_close( $ldapconn );

This code working fine for me . But the same code i pasted in another server just changed the host name for that server and domain name. here i got this error .can you please help me?

$username='ZZZ.YYY';
$domain='test1';
$host='ldap://BBB.test1.org';
$password='XXXX';
$port=389;

$ldapconn = ldap_connect($host, $port)
or die("Could not conenct to {$host}");

if ($ldapconn) {

$bind=ldap_bind($ldapconn, $username .'@' .$domain, $password);

if ($bind) {
    echo("Login correct");
} else {
    echo("Login incorrect");
}

}
ldap_close( $ldapconn );
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 西门子S7-Graph,S7-300,梯形图
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改