Windows LDAP Authentication

I have the 64-bit Windows platform and Postgresql 8.4 installed (since Apache, EnterpriseDB-ApachePHP is installed on Pstgres). I need to authenticate on the system using Active Directory (or LDAP?) Credentials, but even hard I turned on LDAP and restarted Apache in the log error I see PHP Fatal error: call to undefined ldap_connect () function in path / to / my / phpfile . Php script i use below

<?php $user = $_POST[" myUserName@mydomai n.com"]; $pass = $_POST["muPassword"]; //in our system, we already use this account for LDAP authentication on the server above $ldap_serv = 'ldap://192.168.69.10'; $ldap_port = '389'; $lc = ldap_connect($ldap_serv, $ldap_port); ldap_set_option($lc, LDAP_OPT_REFERRALS, 0); ldap_set_option($lc, LDAP_OPT_PROTOCOL_VERSION, 3); $ldapbind = ldap_bind($lc,$user,$pass); if ($ldapbind == false) { echo 'username or password is wrong'; } else { echo "You Logged in"; echo "<br><br><br>Wellcome<br><br><br>"; } ?> 
+4
source share
2 answers

The PHP LDAP extension is required to use LDAP functions. Just check it out without commenting in php.ini ( extension=php_ldap.dll )

+4
source

The PHP extension is clearly not loading. A couple of things to try:

  • run 'php -m' from the command line and make sure ldap is in the list of modules and that there are no ldap related errors.
  • make sure the apache php module uses the modified php.ini (and look for php.ini on the page).
+1
source

Source: https://habr.com/ru/post/1446171/


All Articles