[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

相關文章
相關標籤/搜索