php7安装sphinx遇到的坑

首先按照网上这个方法安装前半部分没有任何问题:
 
[root@centos7-2 ~]# cd /usr/local/src
[root@centos7-2 src]# tar -zxvf sphinx-2.2.10-release.tar.gz
[root@centos7-2 src]# cd sphinx-2.2.10-release
[root@centos7-2 sphinx-2.2.10-release]# ./configure --prefix=/usr/local/sphinx --with-mysql
[root@centos7-2 sphinx-2.2.10-release]# make && make install
 
安装依赖 libsphinxclient
[root@centos7-2 sphinx-2.2.10-release]# cd api/libsphinxclient
[root@centos7-2 libsphinxclient]# ./configure --prefix=/usr/local/sphinx
[root@centos7-2 libsphinxclient]# make && make install
 
但是等到安装PHP的sphinx模块的时候
需要下载支持php7 的sphinx模块,下载页面http://pecl.php.net/package/sphinx 中没有发现支持php7的模块。点击页面中的[ Browse Source ]
进入到页面发现php7的模块
我比较笨,使用浏览器下载tar.gz
然后继续
 
[root@centos7-2 src]# tar -zxvf sphinx-d958afb.tar.gz
[root@centos7-2 src]# cd sphinx-d958afb/
[root@centos7-2 sphinx-d958afb]# phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
 
出现报错信息发现未安装php-devel
[root@centos7-2 sphinx-d958afb]# yum install php71w-devel
[root@centos7-2 sphinx-d958afb]# phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
 
[root@centos7-2 sphinx-d958afb]# ./configure --with-php-config=/usr/bin/php-config --with-sphinx=/usr/local/sphinx/
[root@centos7-2 sphinx-d958afb]# make && make install
 
ok执行完毕
具体配置网上一搜一大把,就不再赘述了。
posted @ 2020-01-31 18:59  不负_时光  阅读(832)  评论(0编辑  收藏  举报