php windows身份验证_php – Windows上的LDAP身份验证

我安装了64位

Windows平台和Postgresql 8.4(因为Apache,EnterpriseDB-Apache

PHP安装在Pstgres上)..我需要使用Active Directory(或LDAP?)凭据对系统进行身份验证,但即使很难我启用LDAP并重新启动Apache错误日志我看到PHP致命错误:在path / to / my / phpfile中调用未定义函数ldap_connect().我使用的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 "
Wellcome
";

}

?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值