我试图在我的ZF2开发的Web应用程序中实现LDAP身份验证。 LDAP认证在Windows 7中工作正常。无法连接LDAP服务器 - 在ldap_bind()中发出问题;
但是,将应用程序移至LINUX机器后,LDAP认证不起作用。我总是得到错误的:警告:的ldap_bind():无法绑定到服务器:无法在线联系LDAP服务器LdapConnect.php 20
我用脚本为:
$ldaphost = "ldap://xxxx.net";
$ldapport = 389;
$ds = ldap_connect($ldaphost, $ldapport) or die("Could not connect to $ldaphost");
if ($ds)
{
$username = "[email protected]";
$upasswd = "password";
$ldapbind = ldap_bind($ds, $username, $upasswd);
if ($ldapbind)
{
print "Congratulations! you are authenticated successfully.";
}else{
print "Better luck next time!";
}
}
我应该安装任何软件包还是应该进行任何配置设置?
注:如果我给的IP地址,然后它工作正常,但如果我给了域名,那么它是不工作。
请帮我解决问题。
夫妇调试技术我建议是1)确保你的Linux节点可以ping你的LDAP节点2)确保你的LDAP绑定到正确的IP地址。我看到LDAP服务器绑定到localhost/127.0.0.1,并导致远程应用程序连接到它。 – beyonddc
Ldap节点ping工作正常。我已经给出了适当的IP地址进行绑定。事件不起作用。同样的事情在开发LINUX机器上工作正常,但不在服务器LINUX机器上。 Plz帮助我。 – KumarA
你有没有在Linux节点上安装php-ldap? – ffledgling