虚拟化容器,大数据,DBA,中间件,监控。

CentOS6.4 X64 安装sphinx及sphinx for php扩展

08 01月
作者:admin|分类:系统运维

CentOS6.4 X64 安装sphinx及sphinx for php扩展

安装前请先确定安装了常用的组件,然后在官方网站下载最新的sphinx,

yum install -y python python-devel

http://sphinxsearch.com/downloads/release/

请使用稳定版,线上机器就别玩beta版啦!

安装sphinx


tar zxvf sphinx-2.1.4-release.tar.gz
cd sphinx-2.1.4-release
./configure --prefix=/usr/local/sphinx –-with-mysql
make && make install
在make时如果出现undefined reference to libiconv的错,请参考 http://www.lvtao.net/database/sphinx-make-error.html 解决方法


libsphinxclient 安装(PHP模块需要)


cd api/libsphinxclient
./configure –prefix=/usr/local/sphinx
make &&  make install
安装PHP的Sphinx模块


下载地址:http://pecl.php.net/package/sphinx


wget http://pecl.php.net/get/sphinx-1.3.0.tgz
tar zxf sphinx-1.3.0.tgz
cd sphinx-1.3.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-sphinx=/usr/local/sphinx/
make && make install
安装好后,在安装目录下etc目录下,有份测试数据和配置的样本



cd /usr/local/sphinx/etc
cp sphinx.conf.dist sphinx.conf
将sphinx.conf里面的数据库地址,账号密码改下就好了,再将lvtao.sql导进数据库lvtao
测试执行



/usr/local/sphinx/bin/search lvtao
就可以看到一些查询的相关信息了
浏览1827 评论0
返回
目录
返回
首页
服务器环境最小化安装后 Centos 6.5优化配置备忘 Proxy HTTP SOCKET5 代理管理器3proxy