我有一个64位的Windows平台和PostgreSQL 8.4安装(例如Apache公司,EnterpriseDB,ApachePHP安装在Pstgres)。我需要使用Active Directory(或LDAP?)凭证,但即使艰难我启用LDAP并重新启动Apache就以系统的身份验证错误日志中我看到PHP的致命错误:调用未定义功能ldap_connect()的路径/要/我的/ phpfile .. PHP脚本我用的是下面,
<?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>";
}
?>