php 更新sphinx,[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的模块

1190000022016497?utm_source=tag-newest

我比较笨,使用浏览器下载tar.gz

1190000022016497?utm_source=tag-newest

然后继续

[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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值