PHP ldap_bind gives the error “Can’t contact LDAP server”

Recently I had an issue connecting to an Active Directory LDAP server from within PHP using the standard ldap_connect and ldap_bind functions.  The problem is, the code I was using was working without problems on a Linux based webserver, so I knew it wasn’t a problem with the PHP code itself or the parameters I was passing.  So… I did some reading and found many people experiencing similar problems, but not all of them for the the same reason as me.  I’m going to summarize in this article the three main problems I came across so that hopefully one of the solutions solves your particular problem.

Read morePHP ldap_bind gives the error “Can’t contact LDAP server”