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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计