在CentOS 7上安裝gearman時,提示錯誤:configure: error: could not find boost,最終解決方案是:php
先安裝:html
# yum install -y boost boost-devellinux
發現問題仍是沒解決,最終經過Bing找到了正確的答案,還要繼續安裝:c++
# yum install gcc-c++.x86_64 gperfgit
最後,再執行 ./configure 完美經過。github
一、下載gearmanspring
進入:https://github.com/gearman/gearmand/releases ,下載: gearmand-1.1.18.tar.gzsegmentfault
二、本地解壓php7
tar -xzvf ./gearmand-1.1.18.tar.gzspa
三、執行
./configure
checking for boostlib >= 1.39... configure: We could not detect the boost libraries (version 1.39 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation. configure: error: could not find boost
網上找了一圈,不少答案都只是寫着:
解決辦法
# yum install -y boost boost-devel便可
摘自:http://www.bubuko.com/infodetail-448566.html
根據提示,進行安裝,並確保已經安裝boost:
[root@iz8vbetvcrpn38l0x1kd06z gearmand-1.1.18]# yum install -y boost boost-devel Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * remi-php71: mirrors.tuna.tsinghua.edu.cn * remi-safe: mirrors.tuna.tsinghua.edu.cn Package boost-1.53.0-27.el7.x86_64 already installed and latest version Package boost-devel-1.53.0-27.el7.x86_64 already installed and latest version Nothing to do
安裝的目錄位於:/usr/include/boost,而且根據上面英文的錯誤提示,查看安裝的boost版本號爲:
#define BOOST_VERSION 105300 #define BOOST_LIB_VERSION "1_53"
版本爲1.53,是高於1.39的。但爲何依然找不到呢?
繼續再從新看多幾遍英文錯誤提示,繼續在/etc/environment追加環境變量:
export BOOST_ROOT=/usr/include/boost
source後依舊不行。
繼續查了一通,在衆多資料中找到了:
搞定了,zypper in gcc gcc-c++,後面這個gcc-c++沒安裝。
摘自:http://tieba.baidu.com/p/3481148738?traceid=
可是仍是有點迷糊。
轉用Bing,在國外找到了解決方案:
I had the same issue compiling 1.1.12
boost-devel was installed but wasn't being detected, even when I pass --with-boostFor whatever reason installing these packages allowed it to compile
yum install gcc-c++.x86_64 gperf
摘自:https://github.com/gearman/gearmand/issues/68
至此,問題已經解決,而且./configure 經過。
config.status: executing libtool commands
---
Configuration summary for gearmand version 1.1.18
* Installation prefix: /usr/local
* System type: pc-linux-gnu
* Host CPU: x86_64
php7的gearman擴展安裝,請參考:https://segmentfault.com/a/1190000011692431
是以記。