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执行完毕
具体配置网上一搜一大把,就不再赘述了。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM