在Windows LDAP认证 [英] LDAP Authentication on Windows
问题描述
我有一个64位Windows平台和PostgreSQL 8.4安装(例如Apache,EnterpriseDB公司,ApachePHP安装在Pstgres)..我需要使用Active Directory系统的身份验证(或LDAP?)凭据,但即使艰难我启用了LDAP和重新启动的Apache的错误登录我看到的 PHP致命错误:调用中的路径/要/我的/ phpfile 的 .. PHP未定义功能ldap_connect()剧本我用的是下面的,
< PHP$ USER = $ _ POST [myUserName@mydomain.com];
$通过= $ _ POST [muPassword];
//在我们的系统,我们已经使用此帐户LDAP认证服务器上的上述
$ ldap_serv ='LDAP://192.168.69.10';
$ LDAP_PORT ='389';
$ LC = ldap_connect($ ldap_serv,$ LDAP_PORT);
ldap_set_option($ LC,LDAP_OPT_REFERRALS,0);
ldap_set_option($ LC,LDAP_OPT_PROTOCOL_VERSION,3);
$ ldapbind =的ldap_bind($ LC,$用户,$通行证);
如果($ ldapbind == FALSE){
回声用户名或密码错误;
}
其他
{
回声您登录;
回声< BR>< BR>< BR>惠康< BR>< BR>< BR>中;
}
?>
PHP LDAP扩展需要使用LDAP功能。只是检查它在你的php.ini注释去掉(扩展= php_ldap.dll
)
i have an 64 bit Windows Platform and Postgresql 8.4 installed(as Apache, EnterpriseDB-ApachePHP is installed on Pstgres).. I need to authenticate to system using Active Directory(or LDAP?) credentials but even tough i enabled LDAP and restarted Apache on error log i see PHP Fatal error: Call to undefined function ldap_connect() in path/to/my/phpfile.. PHP script i use is below,
<?php
$user = $_POST["myUserName@mydomain.com"];
$pass = $_POST["muPassword"];
//in our system, we already use this account for LDAP authentication on the server above
$ldap_serv = 'ldap://192.168.69.10';
$ldap_port = '389';
$lc = ldap_connect($ldap_serv, $ldap_port);
ldap_set_option($lc, LDAP_OPT_REFERRALS, 0);
ldap_set_option($lc, LDAP_OPT_PROTOCOL_VERSION, 3);
$ldapbind = ldap_bind($lc,$user,$pass);
if ($ldapbind == false) {
echo 'username or password is wrong';
}
else
{
echo "You Logged in";
echo "<br><br><br>Wellcome<br><br><br>";
}
?>
The PHP LDAP extension is required to use LDAP functions. Just check it's uncommented in your php.ini (extension=php_ldap.dll
)
这篇关于在Windows LDAP认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!