dongyulan6251 2011-09-15 15:35
浏览 85

LDAP除非使用PHP超时,除非我限制它 - 在ldap结果中编辑:1000限制

Good Morning folks,

I have several scripts which talk to an enterprise LDAP ( MS Active Directory ). I'm finding that if I don't throttle my scripts with sleep() commands I get the following error:

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server in..

What most of my scripts do is get members of Active Directory objects, then finding the members of those results.

I have a function called getMembers() that calls itself while running through the members that it has retrieved, until there are no more results.

I'm finding that I have to:

sleep(1);
getMembers();

For my bind not to fail and time out.

I'm wondering if there is a better way to hammer the crap out of ldap without being kicked out halfway through my scripts. The 1 second pause is going to cause my script to take 97 hours to process all of it's items and I'd like to cut that time by half so I can have it run over the weekend.

Thanks

EDIT --------------------------

So I found out through research that there is a 1000 record limit in LDAP and PHP has no way to page results from LDAP. Due the the way I'm querying LDAP ( 1 query at a time ) I'm able to have it count every iteration that calls to LDAP and when that counter reaches 900 or so, I have it sleep for a minute. This way I'm getting more results. I haven't been able to find a solution for the ldap paging in PHP though.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题