0

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";
 }?>
AliNasiri
  • 137
  • 1
  • 3
  • 11

1 Answers1

0

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