在命令行上运行 ldapsearch 命令时,它会返回大量结果,而通过 PHP 进行的等效(或者我认为)查询什么也不返回。
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);
我错过了什么?