使用ldap for PHP完成连接时?

时间:2014-11-24 10:39:38

标签: php networking ldap

我试图了解PHP的ldap函数以调试应用程序。

身份验证流程如下:

ldap_connect($host, $port);

ldap_set_option($ds, $option);

ldap_bind($ds, $rdn, $pwd);

ldap_search($smth);

ldap_get_entries($smtgelse);

ldap_close($ds);

我得到的错误是:

The gateway did not receive a timely response from the upstream server or application.

我怀疑有防火墙来阻止响应,但我放了一个记录器来查看哪个语句被阻止,它是ldap_bind的。{/ p>

如果它是网络问题,它应该阻止ldap_connect声明吗?

1 个答案:

答案 0 :(得分:2)

从PHP文档 - http://php.net/ldap_connect

When OpenLDAP 2.x.x is used, ldap_connect() will always return a resource as
it does not actually connect but just initializes the connecting parameters.
The actual connect happens with the next calls to ldap_* funcs, usually with
ldap_bind().