PHP程序架在LINUX上能不能用LDAP做用户验证 那我在LINUX下架的服务器跑PHP时,登录的用户和账号用LDAP通过域服务器来验证,可以吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php// using ldap bind *** NOTE the uname *****$ldaprdn = "uid=username,ou=people,dc=172.18.100.3"; //这里这样写可以吗? $ldappass = "password"; // associated password// connect to ldap server$ldapconn = ldap_connect("172.18.100.3") or die("Could not connect to LDAP server.");if (ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3)) { echo "Using LDAPv3";} else { echo "Failed to set protocol version to 3";}if ($ldapconn) { // binding to ldap server $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); // verify binding if ($ldapbind) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; }}?> 我这样写的话,我域服务器的域名我不知道,DC那里写IP可以吗?上面代码还是会报Using LDAPv3Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in F:\BS Projects\test.php on line 20LDAP bind failed... 网站问题 请问为何在连接数据库mysql正常,而在别人的服务器上却失败? 如何将数据库中的html源码显示成网页 mysql里,两表关联,如何获得外键值? 在线等!!!急~~~这个函数中的:$bb=<<<hos代表什么意思? php3文件是不是不能在PHP4里调试 新闻发布系统中文字段落的处理,请高手帮忙!!谢谢 请问高手php的预定义变量有哪些?! CI框架中使用ajax操作数据库问题 求思路,前台被访问时,后台得到通知 (深圳)网络公司若干PHP网站程序找PHP程序员外包,可长期合作 php时间函数
$ldaprdn = "uid=username,ou=people,dc=172.18.100.3"; //这里这样写可以吗?
$ldappass = "password"; // associated password// connect to ldap server
$ldapconn = ldap_connect("172.18.100.3")
or die("Could not connect to LDAP server.");if (ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3)) {
echo "Using LDAPv3";
} else {
echo "Failed to set protocol version to 3";
}if ($ldapconn) { // binding to ldap server
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); // verify binding
if ($ldapbind) {
echo "LDAP bind successful...";
} else {
echo "LDAP bind failed...";
}}?>
我这样写的话,我域服务器的域名我不知道,DC那里写IP可以吗?上面代码还是会报
Using LDAPv3
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in F:\BS Projects\test.php on line 20
LDAP bind failed...