This issue usually occurs for users whose wordpress is hosted on CentOs server. this error because SELinux Boolean httpd_can_
network_connect is not set.
Follow these steps to resolve the issue:
1. Run command: setsebool -P httpd_can_network_connect on
2. Restart apache server.
3. Run command: getsebool –a | grep httpd and make sure that httpd_can_network_connect is on
4. Try Ldap connect from the plugin again