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

2024-08-23php开发问题
2

本文介绍了即使我编辑了 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:

  1. php.ini
  2. 中取消注释 extension = php_ldap.dll
  3. 重要提示:通过检查 phpinfo()
  4. 的输出,确保您正在编辑正确的 php.ini
  5. 检查 php.ini 文件以了解您的扩展目录的位置
  6. 检查 php_ldap.dll 是否位于该目录中
  7. (我错过的步骤) 找到文件 libeay32.dllssleay32.dll 并将它们的目录添加到 Windows PATH李>
  8. 重新启动 Apache.如果启用了 LDAP,在 phpinfo()
  9. 的输出中会有一个关于它的部分
  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()

推荐答案

这里有一些提示:http://php.net/manual/en/ldap.installation.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

这篇关于即使我编辑了 php.ini 并且 php_ldap.dll 在正确的位置,也无法启用 PHP LDAP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17