Maff
Maff

Reputation: 439

Cannot get LDAP extension enabled on new PHP IIS server

I have a new server at work, installed PHP 5.4.21 on it yesterday, got SQLSRV working this morning but now I'm stuck getting LDAP enabled. It's not showing in phpinfo(). This is my php.ini file that is in C:\PHP which is where phpinfo() says is the correct directory: http://pastebin.com/yWv9gRNT

I have uncommented extension=php_ldap.dll (near the bottom), I have the dll in the ext folder that is linked in the php.ini file, I have restarted IIS numerous times, I have even copied all DLLs to Windows\System32 folder as recommended on some forums (including libsasl.dll libeay32.dll & ssleay32.dll) & restarted server. Server is Windows 2008 R2 running IIS 7.5.

Upvotes: 0

Views: 6935

Answers (2)

Maff
Maff

Reputation: 439

OK, I have resolved this, been away for a week, came back to look at it again... Turns out at the very first time (before posting on here) it wasn't working (the dll files weren't in the system32 folder) I followed a few posts on here where people suggest downloading the latest version of PHP and taking the ext folder and copying over the ones we have installed. Today I downloaded the zip that matches my version exactly, overwrote all the newer dlls and it now works perfectly, thank you to all those that helped and offered their expertise and time.

Upvotes: 0

Lokesh Pandey
Lokesh Pandey

Reputation: 1789

Add two other dll libeay32.dll and ssleay32.dll and compile with --with-ldap
Step by step:
1 Add extension = php_ldap.dll in php.ini
2 Make sure that you're editing the right php.ini by checking the output of phpinfo()
3Check the php.ini file for the location of your extensions directory
4Check that php_ldap.dll is located in that directory
5 Find the files libeay32.dll and ssleay32.dll and add their directory to the Windows PATH
6 Reboot server. If LDAP is enabled there will be a section about it in the output of phpinfo()

Upvotes: 1

Related Questions