Skip to content
Branch: master
Find file History
Latest commit 6d5bec5 Mar 6, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
index.php Initial commit of PHP 2 Active Directory LDAP folder Mar 6, 2019

PHP PHP on Linux authenticate users with a Windows Server Active Directory

IF you’re building your application in PHP a very easy way to do this is simply to use PHPs LDAP library and then simply call with the proper functions. Let’s detail the steps below. I’ll be doing this from a PHP 5 , Debian installation.

LDAP tends to be tied into the Windows AD Domain Name System to allow integrated quick lookups and fast resolution of queries. LDAP generally runs on port 389 and like other protocols tends to usually conform to a distinct set of rules (RFC’s). For complete details on this code please click into each sub-folder and check out my blog here:


  • PHP server with LDAP extension loaded
  • Accessible Windows Active Directory Server
  • valid credentials on Windows Active Direcotry server


Place the index.php on any webserver that has PHP enabled. then change the following line to match your environment

   define('DOMAIN_FQDN', 'YOUR_DOMAIN.local'); //Replace with REAL DOMAIN FQDN
   define('LDAP_SERVER', '');  //Replace with REAL LDAP SERVER Address

Project Descriptions

see for more details

You can’t perform that action at this time.