doudong2149 2015-08-31 10:57
浏览 88

提供的资源不是有效的ldap结果条目资源:ldap_get_attributes()

I've just started working on LDAP and trying make an connection between PHP & LDAP.

I've created small script to get all attributes information by referring this script.

$ldap_server = "My_Server_Name";
$ldap_user = "uid=platypus,ou=users,dc=crowd";
$ldap_pass = "My_Password";

$ad = ldap_connect($ldap_server);
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
$bound = ldap_bind($ad, $ldap_user, $ldap_pass);

$result = ldap_read($ad, $ldap_user, "objectClass=*");
$attributes = ldap_get_attributes($ad, $result);

echo "<pre>";
print_r($attributes);

Connection is successfully made, its binding properly as well and ldap_read also giving me #resourse id but ldap_get_attributes giving me following error:

PHP Warning – yii\base\ErrorException ldap_get_attributes(): supplied resource is not a valid ldap result entry resource

Any help would be appreciated.

Thanks

  • 写回答

2条回答 默认 最新

  • duanjia7912 2015-09-01 07:17
    关注

    ldap_get_attributes() expect input parameter to be an single entry not an array. http://php.net/manual/en/function.ldap-get-attributes.php.

    I hope this will help you.

    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)