搜索泥称 发表于 2018-12-19 14:07:46

sphinx+coreseek+php 安装配置过程及其坑

  计划上年年头做的事,中间一直没做,还以为要放弃了,想不到周周转转,在今年年头给做了出来。还是有少少开心的。
  而下都是我在安装过程中的坑,都记录下来了,希望帮到自己又帮到人啦。

[*]  安装mmseg
  

  $ cd mmseg
  

  $ ./configure --prefix=/usr/local/mmseg
  

  $ make
  

  $ make install
  

  安装mmseg3时出现config.status: error: cannot find input file: src/Makefile.in
  

  http://vtrtbb.iteye.com/blog/1933050 (根据不同系统,按需安装,我的是m4)
  

  2.安装Coreseek
  

  ./buildconf.sh (记得要先运行这个,再初始化)
  

  安装Coreseek ./configure时 是报:checking MySQL include files... configure: error: missing include files.
  因为mysql5.5的/usr/local/mysql/lib/mysql是不存在的,所以把--with-mysql-libs这个配置去掉
  

  因为--with-mysql-includes这个配置是需要mysql.h这个文件,而这个文件在mysql的源码里面,所以配置要写成--with-mysql-includes=/root/lnmp1.1-full/mysql-5.5.37/include/ (在实际环境中这个地址要改成其他地方)
  

  不然在make 命令就会报这个错sphinx.h:62:19: error: mysql.h: No such file or directory
  

  ./configure --prefix=/usr/local/sphinx --with-mysql=/usr/local/mysql/ --with-mysql-includes=/root/lnmp1.1-full/mysql-5.5.37/include/ --with-mmseg=/usr/local/mmseg/ --with-mmseg-includes=/usr/local/mmseg/include/mmseg --with-mmseg-libs=/usr/local/mmseg/lib/
  

  make && make install
  

  

  3.php安装sphinx扩展
  安装完 make test报错
  The test-suite requires that proc_open() is available.
  到php.ini 将disable_functions 里面的proc_open这个去掉
  

  4.多表多索引查询
  在/usr/local/sphinx/etc/csft_mysql.cnf 那里写多几个source(根据自己要查多少个表,就写多少个source,包括增量索引),注意在index配置里面的source,要写回对应source源,而php代码如下
$sphObj->AddQuery($keyword, 'goods_brand,goods_cate');
$res = $sphObj->RunQueries()  

  参考链接:
  详细安装配置:http://blog.csdn.net/e421083458/article/details/21529969#t3
  按错错误解决办法:http://vtrtbb.iteye.com/blog/1933050
  配置coreseek支持mysql数据源:http://www.phperz.com/article/14/0615/95.html
coreseek-3.2.14 配置,已经在PHP中实现,还包括了实时更新搜索字段:http://www.cnblogs.com/debuger/archive/2012/07/09/2583206.html
  




页: [1]
查看完整版本: sphinx+coreseek+php 安装配置过程及其坑