sphinxsearch返回“;无法发送客户端协议版本";
在我的一些服务器上,执行sphinx php查询会返回该错误。在谷歌搜索时,我找不到任何东西,但这是错误产生的部分原因:sphinxsearch返回“;无法发送客户端协议版本";,sphinx,Sphinx,在我的一些服务器上,执行sphinx php查询会返回该错误。在谷歌搜索时,我找不到任何东西,但这是错误产生的部分原因: // send my version // this is a subtle part. we must do it before (!) reading back from searchd. // because otherwise under some conditions (reported on FreeBSD for instance) //
// send my version
// this is a subtle part. we must do it before (!) reading back from searchd.
// because otherwise under some conditions (reported on FreeBSD for instance)
// TCP stack could throttle write-write-read pattern because of Nagle.
if (!$this->Send($fp, pack('N', 1), 4))
{
fclose($fp);
$this->error = 'failed to send client protocol version';
return false;
}
我发现最接近的是这个
但是我不知道sphinxapi.php在哪里(我使用手动编译安装),也不确定这是否是个好主意
有人知道吗?我的服务器上也有同样的问题,我意识到我根本没有启动searchd守护进程
希望这有助于首先,让舒尔为api库使用合适的ip。 您可以看到ip正在使用什么 sphinx.config节searchd{} 如果一切正常,下一步就是查看斯芬克斯的状态
searchd—状态问题可能与错误的端口有关。我在
sphinx.config
中设置了两个监听端口:
searchd{
listen = 9312
listen = 9306:mysql41
}
当我试图通过
9306
端口连接时,我遇到了上面提到的错误。将其更改为9312
解决了问题。我对Sphinx 2.2.8也有同样的问题
我发现在这个版本中,searchd配置中的侦听端口集被删除了,现在端口被删除了
listening on all interfaces, port=9312
listening on all interfaces, port=9306
因此,当您配置sphinx客户端时,使用端口9312对我有效。即:
$sphinxClient = new SphinxClient()
$sphinxClient->SetServer("localhost", 9312);
希望这对你有帮助。如果您需要关于基本配置的更多详细信息,请咨询我