doushai7225 2019-08-09 19:50
浏览 181

如何让Ldap在xampp上运行localhost?

I have a issue where on my localhost (running on XAMPP) I get the below error "Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server..."

The same code works on the dev server. I have the same code and when i try running the application on my localhost (using XAMPP), it gives me the error.

I tried the below steps I found online:-

  1. The xampp\php directory has the following files

    • libeay32.dll
    • libsasl.dll
    • ssleay32.dll
  2. I uncommented the ldap extension in the php.ini (xampp\php\php.ini) file to below

    • extension=php_ldap.dll
  3. Restarted the server

  4. xampp\php directory path is also in system environment variable PATH.

  5. phpinfo shows that LDAP is enabled.

Still, not working. Any idea why from localhost it may not work?

Edit: Adding Code


    $hostname = "**********";
    $port = 636;
    $bindDN = "cn=*** ***,ou=binds,dc=***,dc=*******,dc=***";
    $bindPassword = "********";
    if ($conn = ldap_connect('ldaps://' . $hostname . ':' . $port)) {
       if (!ldap_bind($conn, $bindDN, $bindPassword)) {
          return null;
       }
       else {
            return $conn;
       }
    }

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 matlab实现基于主成分变换的图像融合。
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊