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