Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP imap_开放服务器错误:非空初始普通挑战_Php_Imap - Fatal编程技术网

PHP imap_开放服务器错误:非空初始普通挑战

PHP imap_开放服务器错误:非空初始普通挑战,php,imap,Php,Imap,我有一段代码,可以连接到IMAP并下载一些电子邮件附件。直到今天,所有的工作都完美无缺,我不明白为什么,这就是错误 代码如下: Server bug: non-empty initial PLAIN challenge 在我的测试环境中,在修改行之后,所有这些都会再次工作,但是当我提交并更新官方环境时,错误仍然存在 if ($this->mbox = imap_open($this->server,$this->username,$this->password,NULL

我有一段代码,可以连接到IMAP并下载一些电子邮件附件。直到今天,所有的工作都完美无缺,我不明白为什么,这就是错误

代码如下:

Server bug: non-empty initial PLAIN challenge
在我的测试环境中,在修改行之后,所有这些都会再次工作,但是当我提交并更新官方环境时,错误仍然存在

if ($this->mbox = imap_open($this->server,$this->username,$this->password,NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'))) ) // I added the last 3 parameters and in local env all works again.
{
    imap_errors();
    return "OK";
}

在服务器端查找禁用或修改配置后,我尝试添加此代码以禁用普通身份验证,它成功了

这是我最后的代码。我知道像这样测试连接不是很好但是

    if ($this->mbox = imap_open($this->server,$this->username,$this->password) )
    {
        return "OK";
    }elseif ($this->mbox = imap_open($this->server,$this->username,$this->password,NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'))) {
        return "OK";
    }elseif ($this->mbox = imap_open($this->server,$this->username,$this->password,NULL, 1, array('DISABLE_AUTHENTICATOR' => 'PLAIN'))) {
        return "OK";
    }

return imap_last_error();

看起来您的服务器不正确地实现了SASL-PLAIN,或者以您的库不喜欢的方式实现了SASL-PLAIN。试着禁用它以及GSSAPI。谢谢。你能告诉我一些如何禁用它们的线索吗?因为上面的代码已经禁用了GSSAPI验证器。我想我做到了!我会发布答案。。。