web analytics

configure: error: Cannot find libsphinxclient headers ERROR: `/tmp/pear/temp/sphinx/configure –with-sphinx’ failed

Installing SphinxClient
———————————
In a linux machine, you can install sphinx client using pecl install sphinx

But when I tried, it was hitting the error as follows:

configure: error: Cannot find libsphinxclient headers
ERROR: `/tmp/pear/temp/sphinx/configure –with-sphinx’ failed

After a lot of googling, I was about to solve it which is explained below.

1) Download sphinx source from sphinx site
    cd /usr/local/src/
    wget http://sphinxsearch.com/downloads/accept.php?file=sphinx-2.0.4-release.tar.gz

2) Untar it
   tar -xzvf sphinx-2.0.4-release.tar.gz

3) cd sphinx-2.0.4-release/api/libsphinxclient

4) ./configure

5) Once ./configure succeeds it is a common procedure to run make, make install to build the binaries. But here, don’t do it.

6) Instead, install a package named checkinstall

   apt-get install checkinstall

7) cd /usr/local/src/sphinx-2.0.4-release/api/libsphinxclient/
  
   checkinstall -D

   Run the above command in the libsphinxclient folder where you ran ./configure

   You will prompted to answer a few questions, after which you are done with the installation

8) Now run pecl install sphinx again and you will get it working

9) Once it is done, add the sphinx extension to php

   echo “extension=sphinx.so” > /etc/php5/apache2/php.ini

10) Restart apache now
  
    /etc.init.d/apache2 restart

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>