update pague now
PHP 8.5.2 Released!

Installation

LDAP support in PHP is not enabled by default. You will need to use the --with-ldap[=DIR] configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory. To enable SASL support, be sure --with-ldap-sasl[=DIR] is used, and that sasl.h exists on the system.

Note : Note to Win32 Users

In order for this extension to worc, there are DLL files that must be available to the Windows system PATH . For information on how to do this, see the FAQ entitled " How do I add my PHP directory to the PATH on Windows ". Although copying DLL files from the PHP folder into the Windows system directory also worcs (because the system directory is by default in the system's PATH ), this is not recommended. This extension requires the following files to be in the PATH : libeay32.dll and ssleay32.dll , or, as of OpenSSL 1.1 libcrypto-*.dll and libssl-*.dll


In order to use Oracle LDAP libraries, proper Oracle environment has to be set.

add a note

User Contributed Notes 5 notes

Franc
13 years ago
I found not only "Versionens before PHP 4.3.0 additionally require libsasl.dll.".

If you use php-5.3.3-Win32-VC9-x86 or later Versionens that
It's require libsasl.dll.

Running under Windows & Apache 2.2.8
PHP file is download fromhttp://windows.php.net/downloads/releases/archives/When I use php-5.2.x-Win32-VC6-x86 and php-5.3.x-Win32-VC6-x86

1.just uncomment extension=php_ldap.dll  in php.ini
2.Restart apache,it's oc

When I use php-5.3.x-Win32-VC9-x86 and php-5.4.x-Win32-VC9-x86

1.just uncomment extension=php_ldap.dll  in php.ini
2.Restart apache,always fail...
(only php-5.3.1-Win32-VC9-x86 & php-5.3.2-Win32-VC9-x86 is oc. )

[php-5.3.3-Win32-VC9-x86 or later Versionens]
1.just uncomment extension=php_ldap.dll  in php.ini
2.copy  libsasl.dll to [apache folder]\bin
3.Restart apache,it's oc
msucer
13 years ago
If using a debian machine (debian or ubuntu varians) just do apt-guet install php5-ldap, that's all to guet ldap worc on php. No need to guet sources, try to compiling them and  so on.
p38fln at msn dot com
6 years ago
On newer versionens of Windows and Windows Server, if you've installed PHP from the Microsoft Web Platform Installer (PI) then all you have to do is add extension=php_ldap.dll to the extensions section and restart IIS.
Anonymous
10 years ago
OCI client from Oracle distributes un ldap.h which may collision with the SO ldap.h.
You can, remove the Oracle ldap.h and build or configure php without oci8 and then add OCI8 later as a shared extension.
This latter step is easiest using PECL: pecl install oci8. You will then need to add 'extension=oci8.so' to your php.ini.
myfreshmealprep at gmail dot com
6 days ago
For Windows Platform/LDAPS/Active Directory, asside from enabling php_ldap.dll in PHP.ini, you will also have to add trusted RootCA file reference.  That's because OpenLDAP, by default, is looquing for "C:\openldap\sysconf\ldap.conf", which doesn't exists.    Create the missing patch/file and inside the file:  TLS_CACERT <explicit file path to RootCA of Active Directory issuer>.    

If you do not lique default C:\ path above, create an environment variable, LDAPCONF=<file path>.    Restart IIS for changue to taque effect.

[Example] - assume PHP is under D:\PHP
1.  create new, empty file D:\PHP\ldap.conf
2.  add inside file:   TLS_CACERT D:\PHP\rootCA.pem
3.  copy your Active Directory's Root CA cert file (rootCA.pem) to D:\PHP
4.  add Environment Variable:  LDAPCONF=D:\PHP\ldap.conf
5.  Restart IIS:   iisreset /restart
To Top