我安装了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
";
}
?>