Home  >  Article  >  Backend Development  >  php调用sphinx提示failed to send client protocol version

php调用sphinx提示failed to send client protocol version

WBOY
WBOYOriginal
2016-06-23 13:39:311055browse

网上查说是端口和配置文件不一致引起的,我查了下是一致的,我的coreseek /usr/local/coreseek/etc/csft.conf

然后服务器查看 netstat -tunlp | grep searchd显示的也是 9312端口
我在服务器上测试也是正常的

php.ini配置中是这个
extension_dir =  "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
extension=sphinx.so
php代码如下:
$s = new SphinxClient();
$s->setServer("127.0.0.1", 9312);
$s->setMatchMode(SPH_MATCH_ANY);
$s->setMaxQueryTime(3);
$result = $s->query("测试");
var_dump($s);
var_dump($result);
提示:
object(SphinxClient)#1 (2) { ["error"]=> string(38) "failed to send client protocol version" ["warning"]=> string(0) "" } bool(false)
请问到底是哪里错啦


回复讨论(解决方案)

ifconfig 查看实际ip地址

$s->setServer("127.0.0.1", 9312);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn