Installing sphinx and the PECL extension has confused me a couple of times. The installation is arcane and buggy, so I’ve written down the steps to automate it. I’ve used this on Ubuntu 11.10+ . If you know of how to make this work on CentOS or another Linux, let me know. And now, the script :
sudo apt-get install g++
sudo dpkg -i sphinxsearch_2.0.6-release-0ubuntu11~lucid_amd64.deb
sudo make install
sudo pecl install sphinx #Press enter when asked for path
sudo sh -c 'echo "extension=sphinx.so" > /etc/php5/conf.d/sphinx.ini'
sudo service apache2 restart
Hope this saves you some time.