Call to undefined function ldap_connect()

Asked by Bill Gosse

I'm trying to implement the sample code in the The LDAP (a.k.a active directory) plugin. Everything seem to be working fine up until the point when the ldap_connect() call in the AUTH_ldap.class.php is made. Then I get the following:
The message of the error is as follow:

Call to undefined function ldap_connect()

The error occurred in file C:\Dev\xampp\htdocs\phpdev\plugins\PluggableAuth\includes\AUTH_ldap.class.php at line 26

20 $server = parse_url($sourceConfig['url']);
22 if (empty($server['host'])) {
23 return false; // oops
24 }
26 $connect = ldap_connect($server['host'], empty($server['port']) ? 389 : $server['port']);
27 ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
28 ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
30 //$connect=ldap_connect($server['host']);
31 $this->log('Connected');
32 if (!$connect) throw new PHPDS_exception('Unable to connect to the LDAP server');

Is there some other additional softwar that I need to install in order to get this example to work.

Question information

English Edit question
PHPDevShell Edit question
No assignee Edit question
Solved by:
Bill Gosse
Last query:
Last reply:
Revision history for this message
Bill Gosse (bill-gosse) said :

I figure this out. I needed to enable the ldap extension and move some other dll into the path. Now the call is working. Sorry for the newbie question. PHP not my strong suite I've been a Java EE guy for the last 12 years.

Revision history for this message
Bill Gosse (bill-gosse) said :

This link was useful for getting ldap setup correctly in xampp:

Revision history for this message
Greg (gregfr) said :

Thanks for the link. We need to write a proper documentation for the Auth plugin. It'll probably be done after we implement OpenID.