How can I enable LDAP in PHP - Windows Server 2008

I've installed PHP in my Win Server 2008 using Web Platform Installer. The installation was success and I can correctly display phpinfo page from my virtual directory. How can I enable LDAP support? c:\Program Files\PHP\Ext\ doesn't contain php_ldap.dll. Do I have to download this file first?

Edit :

  • I'm using Win Svr 2008 Standard Edition, updated to the latest patch
  • The PHP Version is 5.2.11
  • extension_dir is c:\Program Files\PHP\ext\ (as confirmed by phpinfo())
  • I already downloaded the full PHP zip package (10 megs), and : copythe contents of ext dir to c:\Program Files\PHP\ext\
  • I've already modified the php.ini to include php_ldap.dll extension
  • Here's the screen capture of my phpinfo test page

and the LDAP extension is still not working.


Solution 1:

Your best bet would be to download the latest Zip version of PHP from the PHP.net site and get the DLL from that and extract the DLL file from that.

Not sure why its not included with the web platform installer, seems a little odd.

Solution 2:

I had to enable the module in IIS

start iis manager on windows Server 2008r2

navigate to the root site.

download, install and start php manager (won't install with WordPress over WPI).

scroll to the bottom and click "Enable or disable an extension"

scroll down to the disabled section click on php_ldap.dll to highlight then on the upper right section under actions click "Enable"

exit out and ldap is installed for PHP 5.3.1 that was installed via the "Microsoft Web Platform Installer" when you install "WordPress".

Solution 3:

In my case:
* Windows Server 2008 R2
* PHP 5.3 via WebPlatformInstaller
* IIS

The Error line was:

PHP Fatal error:  Call to undefined function ldap_connect() in ...Tageskonto.php on line 19

has helped to extend the file
* c:\program files (x86)\php\v5.3\php.ini
to load the dll:

[ExtensionList]
extension=php_ldap.dll