Sphinx:Server 发送了客户端未知的字符集。请向开发人员报告

Sphinx:Server sent charset unknown to the client. Please, report to the developers

我正在使用 Sphinx 2.0.5,当我通过 PHP 调用索引器时,我收到错误 Sphinx:服务器发送客户端未知的字符集。请向开发人员报告。可能是什么问题?

服务器PHP版本为5.6.30

仅在尝试使用 mysql 或 mysqli 通过 PHP 连接 Sphinx 时出现问题。

$link = mysqli_connect ( "127.0.0.1", "root", "", "", 9306 ) or sendErrorMail(array("subject"=>"Failed to connect to sphinx ","sql"=>"","error"=> mysqli_connect_error()));

$link = mysql_connect ( "127.0.0.1:9306", "", "" ) or sendErrorMail(array("subject"=>"Failed to connect to sphinx","sql"=>"","error"=> mysql_error()));

是否需要更改任何配置? 我错过了什么?谁能帮忙?

下面的代码工作正常:

    $cl = $this->sphinxclient;
    $cl->resetFilters();
    $cl->SetMatchMode(SPH_MATCH_EXTENDED2);
    $cl->setFilter('eventid',array($param['eventId']));
    $result = $cl->Query('','indexerName');

在 linux 中,Sphinx 使用以下命令正确连接:

mysql -h 127.0.0.1 -P 9306

解决了。 PHP 版本 > 5.4 可能会发生这种情况。 在 Sphinx 安装包中有一个文件 "searchd.cpp"。 那边 server language 指定为 \x00 将其更改为 \x21 并重新安装 sphinx。问题将得到解决。