PHP LDAP connection using URL -


i have problem while trying connect ubuntu server php5 ldap server using url('ldap://hostname/'). code works fine when i'm not using url format ($server = 'hostname').

the code:

$server = 'ldap://hostname/';  $ldapconn = ldap_connect($server, 3268) or die("could not connect ldap server.");  if ($ldapconn) {     $ldapbind = @ldap_bind($ldapconn, 'username', 'password');     $error_ldap_code =  ldap_errno($ldapconn) ;     if($error_ldap_code==0) {         echo 'connected!!!';     } } 

edit:

i needed ldaps, saw ldap have same problem. while problem related ldap solved adding port in url, still had ldaps issue. anyway, managed bypass using ldap_start_tls ( resource $link ) after connecting using hostname (without url format).

try specifying port in url - it's not standard port 389. 'ldap://hostname:3268'?


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -