PHP LDAP bind intermittent issue -


i developing application company requires users log in. automate log in process have tried integrate ldap id , password authentication app. below code have written integration. have checked online , not find 1 facing issue.

i have code ->

function isauthenticated($u,$p) {         $ldap_host = 'my_host';         $ldap = ldap_connect($ldap_host);         ldap_set_option(null, ldap_opt_debug_level, 7);         if($ldap) {                 if($bind = ldap_bind($ldap,$u,$p)) {                     ldap_unbind($ldap);                     return 'authenticated';                 } else {                         return 'invalid credentials';                     }             } else {                     return 'not able connect';                 }     }  $username = 'preventanonymouslogin'; $password = 'preventanonymouslogin';  if(isset($_request['uname'])) {         $username = $_request['uname'];     }  if(isset($_request['password'])) {         $password = $_request['password'];     }  $auth = isauthenticated($username,$password); 

this works of time time not , gives error ->

fatal error: maximum execution time of 30 seconds exceeded in c:\xampp\htdocs\avrs\htdocs\ldap.php on line 12 

i have no idea why work times , times don't. please suggest. in advance.

this same code works intermittently. have tried clear cookies , seems work time not today. so, unless know sure issue think not able fix issue good.

make sure give full dns name ldap_host, e.g. myhost.mydomain.com.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -