php - 服务器不愿意执行。 PHP 中的 LDAP

标签 php authentication ldap openldap

我总是得到这个错误

Server is unwilling to perform

接下来是我的代码:

   echo "Checking ...";
    $username = $_POST["username"];
    $passwd = $_POST["passwd"];
    $host              = 'myhost.co.uk'; 
    $port              = 389; 
    $dn                = 'uid='.$username.',cn=nssproxy,ou=users,dc=co,dc=uk';

   // conexion a ldap

    $conn = ldap_connect( "ldap://".$host.":389") ;

    ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
    ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);

    // match de usuario y password
    $bind = ldap_bind( $conn, $dn, $password );


    if ($bind){
        echo "OK";
    }
    else {
        echo "NO OK";
    }
    echo ldap_error($conn);

为什么我有这个错误?我总是对任何用户进行测试,此脚本返回相同的错误。

提前致谢。

最佳答案

所以我在 Google 上搜索了Server is unwilling to perform,第一个结果是:

C.1.4. ldap_*: server is unwilling to perform

slapd will return an unwilling to perform error if the backend holding the target entry does not support the given operation.

The password backend is only willing to perform searches. It will return an unwilling to perform error for all other operations.

The shell backend is configurable and may support a limited subset of operations. Check for other errors indicating a shortage of resources required by the directory server. i.e. you may have a full disk etc

ldap_mod_replace() [function.ldap-mod-replace]: Modify: Server is unwilling to perform也有一些要求

关于php - 服务器不愿意执行。 PHP 中的 LDAP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22070725/

相关文章:

php - 加载本地 Symfony 包时出现 ClassNotFoundException

php - "not present"是否有验证规则?

email - 如何验证入站邮件?专门使用 SendGrid?

python - 如何删除ldap3中用户的属性?

linux - 如何将新的 LDAP 用户添加到 subversion

php - Sendgrid 错误 400 错误请求

php - tinymce 在内容周围添加 p 标签并将其存储在数据库中,当我使用 PHP 检索时,拆分 p 标签并为每个标签添加一个类的最佳方法是什么

forms - Laravel 从 sqlite DB 登录,获取 "PDOException could not find driver"

asp.net-mvc-3 - 如何在 asp.net MVC 3 中实现/创建基于角色的自定义用户身份验证

c# - AD 中用户的 LDAP 查询带回计算机对象