简体   繁体   中英

Can't contact LDAP server

I am Using Adldap to Auth login in php But it gives error: Can't contact LDAP server.

<?php
  require_once('src/adLDAP.php');
 $adldap = new adLDAP();

 $authUser = $adldap->user()->authenticate('AliNasiri', '******');
 if ($authUser == true) {
   echo "User authenticated successfully";
 }
 else {
     echo $adldap->getLastError()."<br>";
     echo "User authentication unsuccessful";
 }?>

If SELinux is set to enforcing mode It will not allow httpd to connect.

check if SELinux is enforcing getenforce

setsebool -P httpd_can_network_connect 1

Source: http://linux.die.net/man/8/httpd_selinux https://wiki.gentoo.org/wiki/SELinux/Tutorials/Permissive_versus_enforcing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM