PHP and LDAP are not good friends. I had always issues connecting to a Microsoft Active Directory with PHP using the php_ldap module. And it was always a pain in the ass to figure out what went wrong or why it does not want to connect.
My Moodle did not want to connect to the Active Directory and of course, the only feedback by Moodle was an empty string. So let’s start the troubleshooting.
Firstly, find an LDAP browser. For Mac, JXplorer could do it, but it requires JAVA. My slogan is No JAVA for Mac. So I had to use LDAP admin on Windows. The connection was ok, the bind was successful but I got the following warning:
It narrowed my search for a solution and finally, I had found a StackOverflow thread that has provided the fix for my issue. I had to insert the following line in the /etc/ldap/ldap.conf on my webserver:
TLS_REQCERT never
And the result was this:
Cheers,