Here is one of the most important commands which you can use in order to troubleshoot your ldap connections.
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
To show the errors you must use the ldap error function:
ldap_error()
Here is an example of error handling php and ldap:
<?php // Set the ldap server $ldapurl = "ldap.company.com"; // Set the debug flag $debug = true; // Set debugging if ($debug) { ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); } // connect to ldap server $ldapconn = ldap_connect($ldapurl) or die ("Couldn't connect"); // binding to ldap server echo "Trying to bind with $ldapuser - $ldappass\n"; $ldapbind = @ldap_bind($ldapconn, $ldapuser, $ldappass); if (!$ldapbind) { echo "Unable to bind to server $ldapurl\n"; echo "OpenLdap error message: " . ldap_error($ldapconn) . "\n"; exit; } // Rest of code goes here ?>
Thanks a lot, just what i was after
ReplyDeleteThanks Michael, this helped a lot.
ReplyDelete
ReplyDelete:( que se poner en esta definicion xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is so amazing post very interesting.Keep sharing dude.Well done.
ReplyDeleteDownload Latest Version HTTP Debugger Pro Crack
hi was just seeing if you minded a comment. i like your website and the thme you picked is super. I will be back.
ReplyDeletehow to convert psd to wordpress
Crack Download After looking through a few blog articles on your website,we sincerely appreciate the way you blogged.We’ve added it to our list of bookmarked web pages and will be checking back in the nearfuture. Please also visit my website and tell us what you think.Great work with hard work you have done I appreciate your work thanks for sharing it.
ReplyDeleteHTTP Debugger Pro Crack
ReplyDeletecontact-us
MHAPHILIAS