centos7.2 thrift安装实录
centos7.2 thrift安装实录本文出自阿哥论坛:http://it.agoit.com/thread-468535-1-1.html
安装步骤:
1.安装centos需要的扩展
yum install -y automake libtool flex bison pkgconfig gcc-c++ libevent-devel zlib-devel python-devel ruby-devel openssl-devel
2.安装boost,本地源码安装最安全
wget http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz
tar -xvf boost_1_53_0.tar.gz
cd boost_1_53_0
./bootstrap.sh
./b2 install
在安装boost的时候,使用的yum install boost-devel,在最终安装thrift包的时候,会报找不到libboost_unit_test_framework.a文件,并不是google中表述的把/usr/lib64/libboost_unit_test_framework.a 软连接下就好,而是安装后的boost连/usr/lib64/目录下都不存在这个文件libboost_unit_test_framework.a文件;
3.源码安装thrift
wget http://apache.fayea.com/thrift/0.10.0/thrift-0.10.0.tar.gz tar -xvf thrift-0.10.0.tar.gz
cd thrift-0.10.0
./configure --with-lua=no --with-prefix=/usr/local/thrift
make && make install
安装报错及解决办法:
报错一:
libtool: link: g++ -std=c++11 -Wall -Wextra -pedantic -g -O2 -o .libs/processor_test processor/ProcessorTest.o processor/EventLog.o processor/ServerThread.o-L/usr/lib64 ./.libs/libprocessortest.a ../../../lib/cpp/.libs/libthrift.so ../../../lib/cpp/.libs/libthriftnb.so /usr/lib64/libboost_unit_test_framework.a -levent -lrt -lpthread -Wl,-rpath -Wl,/usr/local/thrift/lib
g++: error: /usr/lib64/libboost_unit_test_framework.a: No such file or directory
make: *** 错误 1
make: 离开目录“/opt/soft/thrift-0.12.0/lib/cpp/test”
make: *** 错误 2
make: 离开目录“/opt/soft/thrift-0.12.0/lib/cpp/test”
make: *** 错误 1
make: 离开目录“/opt/soft/thrift-0.12.0/lib/cpp”
make: *** 错误 1
make: 离开目录“/opt/soft/thrift-0.12.0/lib”
make: *** 错误 1
make: 离开目录“/opt/soft/thrift-0.12.0”
make: *** 错误 2
http://note.youdao.com/yws/res/1244/2888B23970E747D5958EF5E34C339A01
解决方案1:
修改方法:先查找文件 find / -name libboost_unit_test_framework.a,比如在 /usr/local/lib/libboost_unit_test_framework.a,就可以做如下操作,sudo ln -s /usr/local/lib/libboost_unit_test_framework.a /usr/lib64/libboost_unit_test_framework.a,然后重新执行 make。
解决方案2:
源码本地编译boost安装;
wget http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz
tar -xvf boost_1_53_0.tar.gz
cd boost_1_53_0
./bootstrap.sh
./b2 install
报错二:
gcc宏编译问题__STDC_FORMAT_MACROS
不要用git包,昂~,因为使用git包在安装的时候会报
src/thrift/server/TNonblockingServer.cpp:460:16: 错误:expected ‘)’ before ‘PRIu32’"(%" PRIu32 " > %" PRIu64
报错三:
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at you
r own risk, by setting the 'disable-tls' option to true.
http://note.youdao.com/yws/res/1280/WEBRESOURCEdd7b64cf28d6509d23a799aaa8a77355
首先需要安装composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
chmod -R 777 /usr/local/bin/composer
composer -V
查看一下您的PHP是在哪个位置,以及php.ini的位置
http://note.youdao.com/yws/res/1284/WEBRESOURCE4d959a4cf2509ab0c05c807e6d244bea
能看到的这边的php是在/usr/local/php/bin/目录下的,那么php.ini也必须位于些目录下。
同时再看php.ini是否开启extension=openssl.so ^
页:
[1]