PHP LDAP Extension

Last Modified: 07-March-2014

The PHP LDAP extension is a 3rd party library required within any PHP environment that uses the PHP LDAP functions. That requirement holds true for the JMapMyLDAP extension. If the PHP environment does not have the extension installed then typically a "White Screen of Death" occurs after an attempted login.

If the PHP LDAP extension is missing then JMapMyLDAP will throw a 991 error with:

[991] Failed to load the PHP LDAP library.

Checking

The PHP LDAP extension can be checked by initiating a phpinfo() and checking if the LDAP extension is listed. This can be directly checked through Joomla! using the PHP Information located in the backend Administrator by clicking through to Site->System Information->PHP Information.

The LDAP extension listing should look similar to this:

phpinfo LDAP extension

Installing

Searching the web for "php ldap extension" and include the platform usually brings up a set of instructions to follow for successful installation. A few common platforms are listed below:

Installation on Windows

  1. Find php_ldap.dll which is generally under the PHP/ext folder.
  2. Open php.ini (inspect phpinfo() for exact location of this file).
  3. Ensure the extension_dir key is pointing to the extensions folder found in step 1. E.g. extension_dir="C:\php\ext".
  4. Remove the comment on the line that contains extension=php_ldap.dll.
  5. Save the file and restart the web server. Recheck phpinfo() for the ldap extension.

Installation on Debian / Ubuntu

Open a terminal and run:
sudo apt-get install php5-ldap
You may have to restart Apache if you're running Apache:
sudo /etc/init.d/apache2 restart

Installation on CentOS / RHEL

Open a terminal and with superuser rights (e.g. using sudo like above or su) run:
yum install php5-ldap
You may have to restart Apache if you're running Apache:
service httpd restart
You may also have to add the following to the php.ini if running an old version:
extension=ldap.so
.