php中出现Sphinx连接错误


sphinx connection error in php

经过多次尝试和研究,我成功地索引了sphinx搜索,使用putty安装了foolz包,但当我试图在我的php文件中搜索时,它给我错误"Warning: mysqli::real_connect(): (HY000/2002): Connection refused in /var/www/html/vendor/foolz/sphinxql-query-builder/src/Connection.php on line 176"下面是我用于搜索的代码。

require "vendor/autoload.php";
use Foolz'SphinxQL'SphinxQL;
use Foolz'SphinxQL'Connection;
$conn = new Connection();
$conn->setParams(array('host' => '127.0.0.1', 'port' => 3312));
$query = SphinxQL::create($conn)->select('column_one', 'colume_two')
    ->from('index_ancient', 'index_main', 'index_delta')
    ->match('comment', 'my opinion is superior to yours')
    ->where('banned', '=', 1);
$result = $query->execute();

,我找不到下一步。这是我现在所指的链接,http://sphinxsearch.com/blog/2014/10/20/sphinxql-query-builder-for-php/。请帮助

我认为你应该修复Sphinx .conf这样的问题:Sphinx搜索mysql客户端在生产服务器

添加mysql客户端监听:

listen = 9306:mysql41