php 致命错误:调用 wamp 中未定义的函数 ldap_connect()
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14415879/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fatal error: Call to undefined function ldap_connect() in wamp
提问by pollux1er
Hoping someone can find out where I am going wrong here, 'cause I'm going around and around and getting no where! I've got a WAMP5 install which integrates PHP Version 5.2.4, Apache/2.2.4 (Win32) and MYSQL on a Win XP machine. All works fine, but I can't get LDAP support to work.
希望有人能找出我在这里出错的地方,因为我四处走动,却无处可去!我有一个 WAMP5 安装,它在 Win XP 机器上集成了 PHP 版本 5.2.4、Apache/2.2.4 (Win32) 和 MYSQL。一切正常,但我无法获得 LDAP 支持。
I've checked extension_dir = "c:/wamp/php/ext/" and extension=php_ldap.dll in php.ini and checked the dll is actually in that folder. I've copied libeay32.dll and ssleay32.dll to the c:windows\system32 folder
我已经检查了 php.ini 中的 extension_dir = "c:/wamp/php/ext/" 和 extension=php_ldap.dll 并检查了 dll 实际上在该文件夹中。我已将 libeay32.dll 和 ssleay32.dll 复制到 c:windows\system32 文件夹
With this code :
使用此代码:
$host = "192.168.56.25";
if (!$ldapconn = ldap_connect($host, 80)) {
echo "Error! Could not connect to LDAP host $host\n";
}
I get this error : Fatal error: Call to undefined function ldap_connect()... I don't know where to start checking because I guess all conditions are achieved for my WAMP to take into consideration Ldap. Please help! Thanks
我收到此错误:致命错误:调用未定义的函数 ldap_connect()... 我不知道从哪里开始检查,因为我猜我的 WAMP 已满足所有条件以考虑 Ldap。请帮忙!谢谢
回答by John Conde
You need to enable LDAP in your php.ini file. Uncomment this line:
您需要在 php.ini 文件中启用 LDAP。取消注释此行:
extension=php_ldap.dll
回答by SeanWM
Make sure that the LDAP extension is installed on your server. There should be a package you need to install. I believe its:
确保您的服务器上安装了 LDAP 扩展。应该有一个你需要安装的包。我相信它的:
sudo apt-get install php5-ldap
sudo apt-get install php5-ldap
You may also want to check the installationguide. You might need to add another two DLLs libeay32.dll and ssleay32.dll.
您可能还想查看安装指南。您可能需要添加另外两个 DLL libeay32.dll and ssleay32.dll。

