脚本宝典收集整理的这篇文章主要介绍了使用PHP进行LDAP身份验证,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
<?PHP $ldaphost = 'ldap://ldapServer'; $ldapport = 389; $ds = ldap_connect($ldaphost,$ldapport) or die("Could not connect to $ldaphost"); ldap_set_option($ldapconn,LDAP_OPT_PROTOCOL_VERSION,3); ldap_set_option($ldapconn,LDAP_OPT_REFERRALS,0); //ldap_set_option($ds,LDAP_OPT_DEBUG_LEVEL,7); if ($ds) { $username = "testuser@domain.COM"; $upasswd = "testpass"; $ldapbind = ldap_bind($ds,$username,$upasswd); if ($ldapbind) {print "Congratulations! $username is authenticated.";} else {print "Access Denied!";} } ?>
但它引发了以下错误:
任何想法,我怎么能解决它?
注意:当我在某个论坛上遇到这个术语时,我们是否需要ldap.config文件.我的机器上没有看到任何这样的文件.我在ext文件夹中使用PHP_ldap.dll并使用Windows.
以上是脚本宝典为你收集整理的使用PHP进行LDAP身份验证全部内容,希望文章能够帮你解决使用PHP进行LDAP身份验证所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。