Nugget Post : Setting LDAP connection timeout for PHP

David Vassallo's Blog

Problem : in some scenarios, for example running a periodic health check on an LDAP / AD server, you may want to set a low timeout so that if a server does not answer LDAP bind requests, a user is notified in a reasonable amount of time. Also, if your PHP code is blocking, a long timeout setting will make your code seem unresponsive. Changing the LDAP connection timeout is not well documented on, so following is a quick example (based on


$ldapconn = ldap_connect(“”);
ldap_set_option($ldapconn, LDAP_OPT_NETWORK_TIMEOUT, 2); /* 2 second timeout */

View original post


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s