即使我编辑了 php.ini 并且 php_ldap.dll 位于正确的位置,仍无法启用 PHP LDAP?

发布于 2024-12-27 00:38:46 字数 1165 浏览 0 评论 0原文

我已经使用 WAMP 安装有一段时间了,现在启用了 LDAP,一切都很顺利。现在,虽然我必须设置另一台机器,但由于某种原因我无法启用 LDAP。

我检查了 phpinfo() 的输出,但 LDAP 部分不存在。我编辑了 php.ini 来取消注释该行:

extension = php_ldap.dll

我还检查了正在搜索扩展名的文件路径,并且文件 php_ldap.dll 位于正确的位置。

肯定我正在编辑正确的php.ini文件,因为我检查了phpinfo()显示的文件路径,而且我我能够成功启用/禁用其他扩展。

每次更改后我都会重新启动 Apache。

在谷歌搜索时,我找到的唯一解决方案就是上面的解决方案,再加上一两次提到编辑 Windows PATH 变量以包含 php.ini 的路径?尝试了一下,尽管它对我来说没有意义(因为我已经知道 php.ini 正在被解析)。我还检查了我之前在另一台计算机上的安装,从我所看到的情况来看,我从未将任何 PHP 目录添加到该计算机上的 PATH

编辑完整答案

弗兰克的答案下面引导我找到了解决方案,所以我想我现在会整合一切。

要在 WAMP 服务器上启用 LDAP 支持:

  1. 取消注释 php.ini 中的 extension = php_ldap.dll
  2. 重要:确保您正在编辑通过检查 phpinfo() 的输出来正确检查 php.ini
  3. 检查 php.ini 文件中扩展目录的位置
  4. 检查 php_ldap.dll位于该目录中
  5. 我错过的一步)找到文件 libeay32.dllssleay32.dll 并将其目录添加到 Windows PATH
  6. 重新启动阿帕奇。如果启用了 LDAP,phpinfo() 的输出中将会有一个关于它的部分

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()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

尸血腥色 2025-01-03 00:38:46

这里有一些提示:http://php.net/manual/en/ldap。安装.php 。请注意,您需要添加另外两个 DLL libeay32.dllssleay32.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

如梦初醒的夏天 2025-01-03 00:38:46

我按照这些说明进行操作,但仍然无法在我的 phpinfo() 中加载 LDAP。 Apache 日志在启动时显示以下非致命消息: ######/php5.4.16/ext/php_ldap.dll - 找不到指定的模块。在 Unknown on line 0

最后,我再次查看 phpinfo() ,发现正在使用系统变量 PATH 而不是我的用户变量 PATH,并且它不包含 PHP 根目录和 PHP 根目录的正确路径扩展文件夹。只需将它们添加到 ####\php\php5.4.16;####\php\php5.4.16\ext; 中并重新启动 Apache,即可解决问题。希望这可以帮助其他人。

I followed these instructions but still couldn't get LDAP loading in my phpinfo(). The Apache logs showed on startup the following non-fatal message: ######/php5.4.16/ext/php_ldap.dll - The specified module could not be found. in Unknown on line 0

In the end, I looked at phpinfo() again and saw that the system variable PATH was being used instead of my user variable PATH and it didn't contain the correct path to PHP's root and PHP's extension folder. Simply adding them in ####\php\php5.4.16;####\php\php5.4.16\ext; and restarting Apache, solved the problem. Hope this can help someone else out.

毁梦 2025-01-03 00:38:46
  1. 检查 PHP 文件夹中的 libsasl.dll libeay32.dllssleay32.dll
  2. 如果 libeay32.dll、< strong>ssleay32.dll 不存在,请从 https://code.google.com/archive/p/openssl-for-windows/downloads
  3. 将它们复制到 Windows 中的 System32 文件夹中
  4. 现在您可以看到您的 LDAP 部分phpinfo()。它对我有用。

我的环境
Windows 10
PHP 7.4.3
阿帕奇2.4.41

  1. Check out libsasl.dll libeay32.dll, ssleay32.dll in your PHP folder
  2. If libeay32.dll, ssleay32.dll are not there, download it from https://code.google.com/archive/p/openssl-for-windows/downloads
  3. Copy them to System32 folder in Windows
  4. Now you can see LDAP section on you phpinfo(). it worked for me.

My environment
Windows 10
PHP 7.4.3
Apache 2.4.41

他不在意 2025-01-03 00:38:46

我正在使用 phpstorm。如果找不到注释,只需将“extension = php_ldap.dll”粘贴到 php.ini 页面的底部即可。不客气

im using phpstorm. if you cant find the comment, just paste"extension = php_ldap.dll" at the bottom of your php.ini page. you are welcome

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文