我总是得到这个错误
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/