Unable to enable PHP LDAP even though I have edited php.ini and php_ldap.dll is in the right place?(即使我编辑了 php.ini 并且 php_ldap.dll 在正确的位置,也无法启用 PHP LDAP?)
问题描述
在启用 LDAP 的情况下,我已经使用 WAMP 安装了很长一段时间,并且一切进展顺利.现在虽然我必须设置另一台机器,但由于某种原因我无法启用 LDAP.
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.
我检查了 phpinfo() 的输出,但 LDAP 部分不存在.我编辑了 php.ini 以取消注释该行:
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
我还检查了正在搜索扩展的文件路径,文件 php_ldap.dll 位于正确的位置.
I also checked the filepath being searched for extensions and the file php_ldap.dll is in the right place.
我肯定我正在编辑正确的 php.ini 文件,因为我检查了 phpinfo() 显示的文件路径,而且我还能够成功启用/禁用其他扩展.
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.
每次更改后我都重新启动了 Apache.
I have rebooted Apache after every change made.
在谷歌搜索时,我发现的唯一解决方案是上面的那些,加上一两次提到编辑 Windows PATH 变量以包含 php.ini 的路径?即使它对我没有意义也尝试过(因为我已经知道 php.ini 正在被解析).我还检查了我之前在另一台机器上的安装,从我所见,我从未在该机器上的 PATH 中添加任何 PHP 目录
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
Frank 下面的回答让我找到了解决方案,所以我想我现在应该整合所有内容.
Frank's answer below led me to the solution so I thought I'd consolidate everything now.
在 WAMP 服务器上启用 LDAP 支持:
To Enable LDAP Support on a WAMP server:
- 在
php.ini 中取消注释 - 重要提示:通过检查
phpinfo() 的输出,确保您正在编辑正确的 - 检查
php.ini文件以了解您的扩展目录的位置 - 检查
php_ldap.dll是否位于该目录中 - (我错过的步骤) 找到文件
libeay32.dll和ssleay32.dll并将它们的目录添加到 Windows PATH李> - 重新启动 Apache.如果启用了 LDAP,在
phpinfo() 的输出中会有一个关于它的部分
extension = php_ldap.dllphp.ini- Uncomment
extension = php_ldap.dllinphp.ini - IMPORTANT: Make sure that you're editing the right
php.iniby checking the output ofphpinfo() - Check the
php.inifile for the location of your extensions directory - Check that
php_ldap.dllis located in that directory - (THE STEP I MISSED) Find the files
libeay32.dllandssleay32.dlland add their directory to the Windows PATH - Reboot Apache. If LDAP is enabled there will be a section about it in the output of
phpinfo()
推荐答案
这里有一些提示:http://php.net/manual/en/ldap.installation.php.请注意,您需要添加另外两个 DLL libeay32.dll 和 ssleay32.dll.您可能还需要使用 --with-ldap
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
这篇关于即使我编辑了 php.ini 并且 php_ldap.dll 在正确的位置,也无法启用 PHP LDAP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:即使我编辑了 php.ini 并且 php_ldap.dll 在正确的位置,也无法启用 PHP LDAP?
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- Laravel 仓库 2022-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
