2010-02-01 71 views
5

在我的一些服务器上,执行一个sphinx php查询返回该错误。谷歌搜索我找不到,除了这个东西是为什么错误就出来了一部分:sphinxsearch返回“未能发送客户端协议版本”

// 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; 
    } 

紧密,我发现这是http://www.sphinxsearch.com/forum/view.html?id=4919

但我不知道在哪里sphinxapi.php是(我使用手动编译安装)并不确定这是个好主意。

任何人有任何想法?

回答

9

我刚刚在我的服务器上遇到同样的问题,我意识到我根本没有启动searchd守护进程。

希望这有助于

0

首先让舒尔你使用合适的ip为api库。 使用什么ip可以看到

sphinx.config部分searchd {}。

如果它是确定下一步就是要看到狮身人面像的状态

searchd的--status

0

这个问题可以用错误的端口。我有两个端口,在我听sphinx.config设置:

searchd{ 
    listen = 9312 
    listen = 9306:mysql41 
} 

当我试图通过9306端口连接,我得到了上面提到的错误。将其更改为9312解决了问题。

0

我有狮身人面像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); 

希望这可以帮助你。如果你需要更多关于基本配置的细节,请问我。

相关问题