The issue may occur due to the following reasons listed below:
1. The LDAP Server URL is incorrect, make sure it is in the correct format.
e.g. ldap://myldapserver.domain:389 , ldap://184.108.40.206:389.
When using SSL, the host may have to take the form ldaps://host:636.
2. Your LDAP Server may be behind a firewall. Check if the firewall is open to allow requests from your WordPress installation.
3. Issue caused by SEBooleans on sites hosted on CentOS. Please refer https://faq.miniorange.com/faq/ldap-authentication/#862
4. Anonymous bind is not supported by Directory server.