Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Call to undefined function ldap_connect() in wamp [closed]

Tags:

php

wamp

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.

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

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

like image 806
pollux1er Avatar asked Jan 19 '13 15:01

pollux1er


2 Answers

You need to enable LDAP in your php.ini file. Uncomment this line:

extension=php_ldap.dll
like image 194
John Conde Avatar answered Nov 07 '22 17:11

John Conde


Make sure that the LDAP extension is installed on your server. There should be a package you need to install. I believe its:

sudo apt-get install php5-ldap

You may also want to check the installation guide. You might need to add another two DLLs libeay32.dll and ssleay32.dll.

like image 7
SeanWM Avatar answered Nov 07 '22 19:11

SeanWM