Installing the PHP LDAP Extension

2026-05-09 12:50:26
Sanplex Content
219
Last edited by WANG JING on 2026-05-09 12:50:26
Share links
Summary : This section provides a straightforward guide on how to install, configure, and verify the PHP LDAP extension for both Windows and Linux environments, which is essential for enabling Sanplex's LDAP authentication.

The LDAP authentication plugin in Sanplex relies on the PHP LDAP extension. To use this plugin, you must install and enable the LDAP extension in your PHP environment if it is not already loaded.

I. Installing LDAP on Windows

  1. If you already have the php_ldap.dll file, open your php.ini file, locate the line ;extension=php_ldap.dll, remove the semicolon (;) to uncomment it, and save the file.
  1. If you do not have the php_ldap.dll file, download the appropriate version that matches your PHP environment, place it in your PHP extension directory, and then repeat step 1.
  1. Restart the Apache service.

II. Installing LDAP on Linux

  1. If your PHP was installed by compiling from source, you need to recompile and reinstall it by adding the --with-ldap parameter.

  2. If your PHP was installed using a Linux package manager, you can install the extension directly through it. For example, on Debian/Ubuntu, run:

    Bash

    sudo apt-get install php-ldap 
  3. Restart the Apache service.

III. Verifying the Installation

Open your phpinfo() test page in the browser. If you see the LDAP section displayed as shown below, the PHP LDAP extension has been successfully enabled.

图1

Write a Comment
Comment will be posted after it is reviewed.