1
在命令行上运行ldapsearch命令时,它会返回大量结果,而通过PHP进行的等效(或我认为)查询不会返回任何结果。PHP ldap_search()和CLI ldapsearch返回不同的结果
ldapsearch命令:
ldapsearch -Zx -H ldap://directory.host.ca -D [CREDENTIALS] -w [PASSWORD] -z 0 -l 0 - LLL -b "ou=people,dc=business,dc=ca" "(&(facultyCode=AU)(term="1380")" uid
PHP搜索:
//binding has already happened with the same credentials as used in the CLI command
$filter = '(&(facultyCode=AU)(term="1380"))';
$list = ldap_search($conn,'ou=people,dc=business,dc=ca',$filter,array('uid'),0,0,0);
我缺少什么?
我没有对服务器的访问日志,但我会玩的报价和看能不能让他们匹配。谢谢。 – Pickle 2012-07-06 14:10:24
单引号,双引号,无引号 - CLI命令始终有效。单引号,双引号,双引号编码为\ 22 - 总是通过PHP返回0个结果。删除引号超时。 – Pickle 2012-07-06 14:54:26
'term'属性值是否有双引号,编码或其他? – 2012-07-06 16:20:42