Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Can you create a phpinfo file and see if the module is actuall loading? –  Sam Oct 13 '09 at 8:34
    
I've created phpinfo file, and the ldap module is not loaded at all. –  Salamander2007 Oct 14 '09 at 2:19
add comment

6 Answers

up vote 2 down vote accepted
+75

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.

share|improve this answer
add comment

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".

share|improve this answer
add comment

On Linux, LDAP is often an optional extension to PHP and needs to be installed separately. This may be the case with Windows too.

share|improve this answer
add comment

If you've uncommented php_ldap.dll in extension section of PHP, I believe that PHP doesn't read proper php.ini.

  • IIRC I always installed PHP to path without spaces in path (e.g. C:\PHP).
  • Try copying C:\program files\php\php.ini to C:\windows\ and restart Apache/IIS.

Maybe some of this helps you.

share|improve this answer
    
I think the PHP.ini load successfully because phpinfo() yields "Loaded Configuration File : C:\Program Files\PHP\php.ini" –  Salamander2007 Oct 13 '09 at 6:58
    
Did you try it? IIRC I had trobles enabling extensions... and I solved it by moving php.ini to the right place and finally setting proper PATH variable. –  blank3 Oct 13 '09 at 10:49
add comment

So you may need to check the following things at phpinfo():

  1. If you are using IIS, check to make sure that your IIS Worker Process has read access on NTFS to your "C:\Program Files\PHP" directory. This Worker Process could be NETWORK SERVICE or IWAM_<computername> or LOCAL SYSTEM (I hope not).
  2. When you load up phpinfo(); in the output check the following lines to ensure they are where you expect it to be:
    -- extension_dir
    -- Loaded Configuration File
    These items need to be where you expect them to be reporting and not loaded from some place else.
  3. You also need to add files to the system's "PATH": libeay32.dll and ssleay32.dll, and will likely require a system restart to pick up; and as some users have documented, putting the PATH near the beginning of the PATH variable may eliminate some problems. This is documented here: http://us2.php.net/manual/en/ldap.installation.php
share|improve this answer
    
Loaded Configuration File : C:\Program Files\PHP\php.ini –  Salamander2007 Oct 14 '09 at 2:07
add comment

I didn't read the original question enough to see he already enabled php_ldap.dll, but that was my problem.

On a recent (early 2014) WPI install, the php_ldap.dll is there and ready to go, it's just not configured in php.ini.

  1. The output of phpinfo() doesn't include the ldap section
  2. Edit PHP.ini as administrator (see phpinfo() for full path... mine happens to be in C:\Program Files (x86)\iis express\PHP\v5.4\php.ini
  3. WPI puts the enabled modules at the bottom of the file. Add extension=php_ldap.dll
  4. phpinfo() immediately shows the ldap section.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.