Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
902 views
in Technique[技术] by (71.8m points)

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

I've been working with a WAMP install for quite a while now with LDAP enabled and everything is going smoothly. Now though I have to set up another machine and for some reason I can't enable LDAP.

I checked the output of phpinfo() and the LDAP section isn't there. I edited php.ini to uncomment the line:

extension = php_ldap.dll

I also checked the filepath being searched for extensions and the file php_ldap.dll is in the right place.

I'm positive I'm editing the right php.ini file since I checked the filepath being shown by phpinfo(), and also I am able to successfully enable/disable other extensions.

I have rebooted Apache after every change made.

While Googling this, the only solutions I found were those above, plus one or two mentions of editing the Windows PATH variable to include the path to php.ini? Tried it even though it didn't make sense to me (as I already know php.ini is being parsed). I also checked my previous install on the other machine and from what I can see I never added any PHP directories to the PATH on that machine

Edit with complete answer

Frank's answer below led me to the solution so I thought I'd consolidate everything now.

To Enable LDAP Support on a WAMP server:

  1. Uncomment extension = php_ldap.dll in php.ini
  2. IMPORTANT: Make sure that you're editing the right php.ini by checking the output of phpinfo()
  3. Check the php.ini file for the location of your extensions directory
  4. Check that php_ldap.dll is located in that directory
  5. (THE STEP I MISSED) Find the files libeay32.dll and ssleay32.dll and add their directory to the Windows PATH
  6. Reboot Apache. If LDAP is enabled there will be a section about it in the output of phpinfo()
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There are a few hints here: http://php.net/manual/en/ldap.installation.php . Note you need to add two other DLLs libeay32.dll and ssleay32.dll. You may also need to compile with --with-ldap


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...