php - LDAP Auth on WAMP -
i'm trying write ldap authentication code on wamp server.
i'm using this:
<?php error_reporting(e_all); ini_set("display_errors", 1); $ldapconfig['host'] = 'my.server.province.country'; $ldapconfig['port'] = 389; $ldapconfig['basedn'] = 'dc=x,dc=y,dc=z,dc=x1'; $ldapconfig['authrealm'] = 'my realm'; ldap_connect($ldapconfig['host'], $ldapconfig['port']) or die ('could not connect'); echo 'connected'; ?>
i'm getting error:
fatal error: call undefined function ldap_connect() in c:\program files\apache software foundation\apache2.2\htdocs\oplweb\index.php on line 10
from basic googling, looks need turn on mod_ldap. seems simple. i've done following:
- went c:\program files\apache software foundation\apache2.2\modules , made sure mod_ldap.so exists.
- i've gone c:\program files\apache software foundation\apache2.2\conf\httpd.conf , made sure line not commented out: loadmodule ldap_module modules/mod_ldap.so
- i've gone c:\program files\php\php.ini , made sure line not commented out: extension=php_ldap.dll
- restart apache
the problem still persists. ldap_connect() function in php have other dependencies? missing step?
cheers
i ran same issue windows server 2008 - have added php.ini file windows path?
go control panel , open system icon (start -> settings -> control panel -> system, or start -> control panel -> system windows xp/2003+)
go advanced tab
click on 'environment variables' button
look 'system variables' pane
find path entry (you may need scroll find it)
double click on path entry
enter php directory @ end, including ';' before (e.g. ;c:\php)
press ok
Comments
Post a Comment