Skip to content

Instantly share code, notes, and snippets.

@theredstapler
Created August 6, 2016 16:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save theredstapler/38d1baccdb5b6e909bc7aeff5658eb5d to your computer and use it in GitHub Desktop.
Save theredstapler/38d1baccdb5b6e909bc7aeff5658eb5d to your computer and use it in GitHub Desktop.
<?php
$ldap_dn = "cn=read-only-admin,dc=example,dc=com";
$ldap_password = "password";
$ldap_con = ldap_connect("ldap.forumsys.com");
ldap_set_option($ldap_con, LDAP_OPT_PROTOCOL_VERSION, 3);
if(ldap_bind($ldap_con, $ldap_dn, $ldap_password)) {
echo "Bind successful!";
} else {
echo "Invalid user/pass or other errors!";
}
?>
@SILKP
Copy link

SILKP commented Apr 16, 2018

ldap_bind(): Unable to bind to server: Can't contact LDAP server in /var/www/html/Test/index.php on line 9 i am getting this problem . how to solve this ?

@abaciocco
Copy link

that test ldap server is from 2014... must be down at present time for sure

@todomagichere
Copy link

Still up @abaciocco

@kevinj4come
Copy link

The test ldap server is still up ? because I try to connect to it and it say "Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in..."

@todomagichere
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment