|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59416 No results being returned
Submitted: 2010-09-13 14:54 UTC Modified: 2010-09-20 02:25 UTC
From: rich06 at gmail dot com Assigned:
Status: Closed Package: sphinx (PECL)
PHP Version: 5.3.2 OS: Mac OS X 10.5.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rich06 at gmail dot com
New email:
PHP Version: OS:


 [2010-09-13 14:54 UTC] rich06 at gmail dot com
I am trying to test Sphinx on my Mac development server (I am actually running PHP 5.3.3 however that version is absent from the selection list) and have installed the PECL extension to PHP. Sending a search query as follows:-

$s = new SphinxClient;
$result = $s->query('foo');

Several results are obtained using the CLI search tool with the same search string;

The error returned by searchd is 'failed to send client protocol version'. This issue is discussed on the Sphinx site here -> and there is a fix described for the userland PHP API but I cannot see how to send the client protocol string using the PECL extension...

Reproduce code:
$s = new SphinxClient;
$result = $s->query('foo');

Expected result:
Expect to get several results.

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-15 12:11 UTC] santiago739 at gmail dot com
What is a version number of your Sphinx server and 
 [2010-09-15 14:39 UTC] rich06 at gmail dot com
Sphinx server is 0.9.9 and the libsphinxclient is the one that came with the server source code under the api directory.. following is from the .h file

// $Id: sphinxclient.h 2067 2009-11-13 23:23:06Z shodan $

 [2010-09-16 10:51 UTC] santiago739 at gmail dot com
Unfortunately, I can't reproduce this bug, everything works 
fine with the same versions. Do you face this issue every 
query or time to time?
If it possible could you reproduce this issue on the 
different platform?
It seems this is specific bug in libsphinxclient and it's 
related with your platform.
 [2010-09-16 17:01 UTC] rich06 at gmail dot com
OK I just tested on a Ubuntu 10.04 server with the same code as below:

$s = new SphinxClient;
$result = $s->query('foo','getProductsByName');


object(SphinxClient)#1 (2) {
  string(38) "failed to send client protocol version"
  string(0) ""
 [2010-09-17 12:19 UTC] santiago739 at gmail dot com
Are you sure that your searchd is running on localhost:6712?

If it's ok, please try to compile and run this code:

# test.c

#include <stdio.h>
#include <stdlib.h>

#include "sphinxclient.h"

int main ()
    sphinx_client *client;
    sphinx_result *res;
    sphinx_bool res_bool;
    const char *query, *index;
    query = "foo";
    index = "getProductsByName";

    client = sphinx_create(SPH_TRUE);
    if (!client) {
        printf("failed to create client\n");
    res_bool = sphinx_set_server(client, "localhost", 6712);
    if (!res_bool) {
        printf("failed to set server\n");
    res_bool = sphinx_set_match_mode(client, SPH_MATCH_ANY);
    if (!res_bool) {
        printf("failed to set match mode\n");
    res_bool = sphinx_set_max_query_time(client, 3);
    if (!res_bool) {
        printf("failed to set max query time\n");
    res = sphinx_query(client, query, index, NULL);
    if (!res) {
        printf("query failed: %s\n", sphinx_error(client));
    printf("Query '%s' retrieved %d of %d matches.\n", 
        query, res->total, res->total_found);

    return 0;

$gcc -lsphinxclient -o test test.c
 [2010-09-19 16:54 UTC] rich06 at gmail dot com
I've closed this bug. The configuration file had searchd listening on another port... 

I'm very sorry to have wasted your time on this however the error message about 'missing client protocol versions' is IMO a bit misleading...

Thanks for your help with this...
 [2010-09-20 02:25 UTC] santiago739 at gmail dot com
It's just a copy of error message from linsphinxclinet. I 
agree that this is a bit misleading and perhaps it makes 
sense to open related bug on

Thank you for your interest in PECL.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jan 29 15:05:54 2023 UTC