Unable to enable PHP LDAP even though I have edited php.ini and php_ldap.dll is in the right place?

Unable to enable PHP LDAP even though I have edited php.ini and php_ldap.dll is in the right place?

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Unable to enable PHP LDAP even though I have edited php.ini and php_ldap.dll is in the right place?

LDAP support often feels like a "set it and forget it" extension once you get it working on your primary development machine. But when you attempt to replicate that environment on a fresh WAMP install, it can vanish into thin air. You might find yourself staring at a phpinfo() output with no LDAP section, convinced you are doing everything right: the extension = php_ldap.dll line is uncommented in php.ini, the DLL is present in the extensions directory, and Apache has been restarted.

This scenario happens frequently because Windows PHP environments operate differently than Linux counterparts. In a typical WAMP setup, simply enabling the extension file isn't enough; you also need to ensure the underlying cryptographic libraries required for LDAP operations are accessible to the process.

The most common oversight involves the dynamic link libraries that handle SSL/TLS connections, which LDAP frequently relies on. Specifically, you must locate libeay32.dll and ssleay32.dll. These files are part of the OpenSSL library distribution. If these DLLs are not found in a location listed in your system's PATH environment variable, or if they are missing entirely from the expected directories, the PHP interpreter will fail to load the LDAP extension silently.

Verifying the Active Configuration

Before digging into dependencies, it is critical to confirm you are editing the correct configuration file. On Windows servers, especially with WAMP, there can be multiple php.ini files: a default template, a customized one in the installation root, and a virtual host-specific override if you have configured Apache for that.

To bypass this ambiguity, run phpinfo() via your browser or CLI. The output will clearly display the "Loaded Configuration File" path at the top of the document. If you are editing a file located two directories up from where phpinfo() says it is looking, your changes will have zero effect. This is a frequent source of frustration; developers assume their edits persist, only to discover they are modifying an inactive copy.

The Missing Cryptographic Dependencies

Once you confirm the correct php.ini and ensure extension = php_ldap.dll is uncommented, inspect the extensions directory specified within that file (often extension_dir). You must verify that php_ldap.dll sits there physically. However, the presence of the extension file alone does not guarantee functionality if its runtime dependencies are missing from the system path.

LDAP implementations often depend on OpenSSL for secure protocol handling. This is where the step most developers miss comes in: finding libeay32.dll and ssleay32.dll. These files usually reside alongside the main PHP binaries or within an ext\php_openssl folder if you installed that extension separately.

If these DLLs are not in a directory included in your Windows PATH, the process executing Apache cannot resolve them when it attempts to load the LDAP module. Unlike Linux, where shared libraries are often managed globally or via specific LD_LIBRARY_PATH settings, Windows requires these binaries to be explicitly reachable if they aren't in the immediate application directory.

To resolve this:

  1. Locate libeay32.dll and ssleay32.dll on your system. They are often found in the root of your PHP installation or within a specific OpenSSL folder.
  2. Add the directory containing these files to your Windows PATH environment variable.
  3. Restart the Apache service completely. A simple reload isn't always sufficient if the process manager has cached paths; a full restart ensures the new environment context is applied.

After rebooting Apache, refresh your phpinfo() page. If the LDAP section appears, the configuration is successful. If it remains absent, double-check that you haven't inadvertently removed these DLLs from your system path or if conflicting versions of OpenSSL are blocking the load. This dependency resolution is a classic Windows-specific nuance that prevents the extension from initializing until all binary prerequisites are satisfied.

Our network