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

发布时间:2020-07-29 20:56:20 作者:gzcxl123
来源:网络 阅读:601

计划上年年头做的事,中间一直没做,还以为要放弃了,想不到周周转转,在今年年头给做了出来。还是有少少开心的。

而下都是我在安装过程中的坑,都记录下来了,希望帮到自己又帮到人啦。

  1. 安装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. 控制台程序,打印pe头信息
  2. include require区别

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

include cannot files

上一篇:AIX Study之--用户访问系统资源限制配置

下一篇:内网访问baidu慢且丢包严重

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》