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

826

I'm using Sphinx 2.0.5 and while I call indexer through PHP, Im getting error Sphinx:Server sent charset unknown to the client. Please, report to the developers. What can be the problem ?

Server PHP version is 5.6.30

Only problem occurs when trying to connect Sphinx using mysql or mysqli via PHP.

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

OR

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

Is the a requirement of any configuration changes ? What am I missing ? Can anyone help ?

Below code works fine :

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

In linux Sphinx gets connected properly using below command :

mysql -h 127.0.0.1 -P 9306

10

Answer

Solution:

Got it solved. Probably this occurs with PHP version > 5.4. In Sphinx Installation Bundle there is a file "searchd.cpp". Over there server language is specified as \x00 change it to \x21 and reinstall sphinx. Problem will be solved.

People are also looking for solutions to the problem: php - Only read array if SQL search gives results

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.