Welcome, Guest. Please login or register.
+  AppServ Forum
|-+  AppServ Support Forum» AppServ Support in English» Call to undefined function ldap_connect()
Username:
Password:
 
Pages: [1]
  Print  
Author Topic: Call to undefined function ldap_connect()  (Read 5486 times)
venomski
Newbie
*
Posts: 1


View Profile
« on: March 13, 2007, 05:26:27 pm »

Hello,

I want to set up an intranet site where user log in with their Active Directory username and password using LDAP.

I have Appserv 2.5.7 running on my machine (windows xp SP2):
#  Apache Web Server Version 2.2.3
# PHP Script Language Version 5.1.6
# MySQL Database Version 5.0.24a
# phpMyAdmin Database Manager Version 2.9.0.2

We have an exchange 2003 server with ldap.

I use the following script to let users log in:

Code: (php)
<?php 

$ldap
['host'] = '192.168.1.2'
$ldap['port'] = 389

function 
ldap_authenticate($username$password) { 
  global 
$ldap

  
$conn ldap_connect($ldap['host'],$ldap['port']); 

 if (
$conn) {
        if (
ldap_bind$conn$username$password) ) { 
            
ldap_close($conn);
            return 
TRUE
        } 
  }
  
ldap_close($conn);
  return 
FALSE;  


if (!
ldap_authenticate('user@domain.local''pass')) { 
  echo 
'Authorization Failed'
} else {
    echo 
'Welcome';
}

?>


When i use this code, i get the following:
Quote
Call to undefined function ldap_connect()

Appserv has ldap-support and i have uncommentet "extension=php_ldap.dll" in the php.ini file but still no result.

Can anybody help me?
Logged
hockeyshooter
Global Moderator
YaBB God
*****
Posts: 968


The sound of inevitability


View Profile WWW
« Reply #1 on: March 18, 2007, 11:26:41 pm »

From personal experience, extension=php_ldap.dll requires both libeay32.dll and ssleay32.dll in the windows/system32 folder.

Chris.
Logged

Freelance sports photography
http://www.hockeyphotos.com
Pages: [1]
  Print  
 
Jump to: