我已在php.ini里增加了这个扩展,并在class里写下如下代码:
public function doLogin(){
$username = "companydomain\\".$_POST['username'];
$password = $_POST['password'];
$conn = ldap_connect('192.168.1.4') or die('无法连接AD服务器');;
if ($conn)
{
$bind = ldap_bind($conn,$username, $password); // 如果连接了,便进行登入
if ($bind)
{
$this->success("验证通过",U('/admin/index/index'));
} else {
$this->error('登录失败');
}
ldap_close($conn);
}
运行,出现如下错误:Call to undefined function ldap_connect()
请问是否是开启这个扩展的时候出错了?!
最佳答案
