sphinx客户端libsphinxclient安装(下面PHP模块需要)
# cd /sphinx-2.2.11-release/api/libsphinxclient # ./configure --prefix=/usr/local/libsphinxclient # make # make install
安装PHP的Sphinx模块
下载地址:http://pecl.php.net/package/sphinx
# wget http://203.187.160.133:9011/pecl.php.net/c3pr90ntc0td/get/sphinx-1.3.3.tgz //下载 # tar zxf sphinx-1.3.3.tgz //解压 # cd sphinx-1.3.3 //进入安装目录 # /usr/local/php/bin/phpize #用phpize生成configure配置文件 # ./configure --with-php-config=/usr/local/php5/bin/php-config --with-sphinx=/usr/local/libsphinxclient # make # make install Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/ //完后返回的路径
打开php.ini 跳转到尾部,添加以下代码
[sphinx] extension_dir = /usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/ extension = sphinx.so
重启php之后,查看phpinfo()是否有sphinx扩展