六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 932|回复: 0

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

[复制链接]
 楼主| 发表于 2016-2-25 15:13:42 | 显示全部楼层 |阅读模式
CentOS6.4 X64 安装sphinx及sphinx for php扩展
            安装前请先确定安装了常用的组件,然后在官方网站下载最新的sphinx,
yum install -y python python-develhttp://sphinxsearch.com/downloads/release/
请使用稳定版,线上机器就别玩beta版啦!
安装sphinx
tar zxvf sphinx-2.1.4-release.tar.gzcd sphinx-2.1.4-release./configure --prefix=/usr/local/sphinx –-with-mysqlmake && 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/sphinxmake &&  make install安装PHP的Sphinx模块
下载地址:http://pecl.php.net/package/sphinx
wget http://pecl.php.net/get/sphinx-1.3.0.tgztar zxf sphinx-1.3.0.tgzcd 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/etccp sphinx.conf.dist sphinx.conf将sphinx.conf里面的数据库地址,账号密码改下就好了,再将lvtao.sql导进数据库lvtao
测试执行
/usr/local/sphinx/bin/search lvtao就可以看到一些查询的相关信息了
        

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

该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表