致命错误:调用未定义函数:ldap_connect() [英] Fatal error: Call to undefined function: ldap_connect()
问题描述
使用WAMP时出现此错误:
I get this error when using WAMP:
致命错误:调用未定义函数:
ldap_connect()
我已经编辑了php.ini
文件夹并启用了php_ldap.dll
.
I have already edited the php.ini
folder and enabled php_ldap.dll
.
由于某些原因,当我打开它们时,只有某些扩展名显示在phpinfo()
中.我已经重新启动了Apache并重新启动了我的计算机.
For some reason only some of the extensions show up in phpinfo()
when I turn them on. I have restarted Apache and restarted my computer.
推荐答案
如果您是Windows用户,则使用XAMPP
时这是一个常见错误,因为默认情况下未启用LDAP
.
If you are a Windows user, this is a common error when you use XAMPP
since LDAP
is not enabled by default.
您可以按照以下步骤操作,以确保LDAP
在您的XAMPP
中可以正常工作:
You can follow this steps to make sure LDAP
works in your XAMPP
:
-
[Your Drive]:\xampp\php\php.ini
:在此文件中取消注释以下行:
[Your Drive]:\xampp\php\php.ini
: In this file uncomment the following line:
extension=php_ldap.dll
将文件:libsasl.dll
从[Your Drive]:\xampp\php
移到[Your Drive]:\xampp\apache\bin
(注意:只有XAMPP之前的版本:5.6.28
,才需要移动文件)
Move the file: libsasl.dll
, from [Your Drive]:\xampp\php
to [Your Drive]:\xampp\apache\bin
(Note: moving the file is needed only for XAMPP prior to version: 5.6.28
)
如果您使用Linux:
If you use Linux:
对于php5:
sudo apt-get install php5-ldap
对于php7:
sudo apt-get install php7.0-ldap
运行上述命令应该可以解决问题.
running the above command should do the trick.
这篇关于致命错误:调用未定义函数:ldap_connect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!