[php7安装sphinx遇到的坑]

php7安装sphinx遇到的坑php

首先按照网上这个方法安装前半部分没有任何问题:html

地址:https://www.cnblogs.com/xi-jie/articles/10476860.htmlmysql

[root@centos7-2 ~]# cd /usr/local/srcgit

[root@centos7-2 src]# wget http://sphinxsearch.com/files/sphinx-2.2.10-release.tar.gzsql

[root@centos7-2 src]# tar -zxvf sphinx-2.2.10-release.tar.gzcentos

[root@centos7-2 src]# cd sphinx-2.2.10-releaseapi

[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 installphp7

安装依赖 libsphinxclientui

[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

相关文章
相关标签/搜索