Error with authentication via LDAP

Error with authentication via LDAP

by David Deeg -
Number of replies: 2

I have following error while authentificate via LDAP:

Fatal error: Call to undefined function: ldap_connect() in c:\apache1\apache\htdocs\auth\ldap\lib.php on line 221

line 221 looks like this:

$result = ldap_connect ($CFG->ldap_host_url);

I did not change anything in lib.php.

Any idea?

Average of ratings: -
In reply to David Deeg

Re: Error with authentication via LDAP

by Shane Elliott -
Picture of Core developers Picture of Plugin developers

Has LDAP support been enabled on your version of PHP? It's disabled by default. There is more info on LDAP and PHP at: http://www.php.net/manual/en/ref.ldap.php

The following excerpt from the above link may be of some help seeing as you are using a Windows system.


LDAP support in PHP is not enabled by default. You will need to use the --with-ldap[=DIR] configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory.

Note to Win32 Users: In order to enable this module on a Windows environment, you must copy several files from the DLL folder of the PHP/Win32 binary package to the SYSTEM folder of your windows machine. (Ex: C:\WINNT\SYSTEM32, or C:\WINDOWS\SYSTEM). For PHP <= 4.2.0 copy libsasl.dll, for PHP >= 4.3.0 copy libeay32.dll and ssleay32.dll to your SYSTEM folder.

In reply to Shane Elliott

Re: Error with authentication via LDAP

by David Deeg -
Thank you for your help, now I can connect.