mathermann / php-ldap-client
PHP LDAP client
Installs: 26
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/mathermann/php-ldap-client
Requires
- php: >=5.4
- ext-ldap: *
This package is auto-updated.
Last update: 2025-11-25 02:50:57 UTC
README
Easily authenticate users and deal with LDAP server in PHP
Usage
<?php require_once 'vendor/autoload.php'; use MatHermann\Ldap\Exception\LdapException; use MatHermann\Ldap\LdapClient; try { $host = '127.0.0.1'; $port = 389; $dn = 'DC=yourDomain,DC=com'; $OU = 'yourOrganizationalUnit'; $username = 'yourUsername'; $password = 'yourPassword'; $client = new LdapClient($host, $port, $dn); $user = $client->signInUser($username, $password, "OU=$OU"); var_dump($user); // Access user properties with $user->get('property') } catch (LdapException $exception) { var_dump($exception); // Handle LDAP exceptions }