coreseek安装和使用(一)

2017-03-22  本文已影响2124人  Mr_Lance

sphinx和coreseek

coreseek安装流程和遇到问题的解决方法

  1. 第一步下载coreseek安装包,点击下载coreseek的3.2.14.tar.gz版本
  2. 下载完成后解压进入coreseek目录,会发现有两个目录csft-3.2.14和mmseg-3.2.14,这里简单说明下:Csft-3.2.14就相当玩sphinx安装目录,mmseg-3.2.14即为中文分词安装包,先安装中文分词库,请看代码:
    Cd coreseek-3.2.14/ mmseg-3.2.14
    ./configure --prefix=/usr/local/mmseg/
    

./configure出现错误:config.status: error: cannot find input file: src/Makefile.in
要先安装automake,再重新执行configure

yum -y install autoconf automake
aclocal
yum -y install libtool
aclocal
libtoolize –force
automake --add-missing
make
make install
  1. 安装中文分词mmseg完毕,安装coreseek。
cd ../ csft-3.2.14
./configure --prefix=/usr/local/coreseek --with-mysql=/usr/local/mysql --with-mmseg-includes=/usr/local/mmseg/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg/lib/
make
make install
        ```
但我的环境是使用yum直接安装的lnmp,不知道mysql的地址。需要先安装mysql-devel ,再安装csft的时候直接用-with-mysql 会自动搜索安装的mysql的文件。重新执行上面的代码,--with--mysql不用带参数,自动搜索。

4. 安装好coreseek和mmesg我们要给php加上sphinx模块,这样php就可以用到sphinx软件的功能,先下载php的sphinx模块包,代码如下

wget http://pecl.php.net/get/sphinx-1.1.0.tgz
tar zxvf sphinx-1.1.0.tgz
cd sphinx-1.1.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

安装扩张有可能遇到的错误:
一、configure: error: Cannot find libsphinxclient headers
解决方法:进入下载包的ctsf文件夹的api文件夹找到libsphinxclient文件夹,进入文件夹编译安装configure make && make isntall
二、/root/sphinx-1.1.0/sphinx.c:1888:43: warning: assignment from incompatible pointer type [enabled by default]
这是因为扩张的版本和以安装的php的版本之间代码的严格行造成的。
修改sphinx.c文件105行,添加默认值null
retval = std_hnd->read_property(object, member, type TSRMLS_CC, NULL);
配置扩展:在php.ini的下面加上:extension=”sphinx.so”
上一篇下一篇

猜你喜欢

热点阅读