thrift之初体验

时间:2024-01-10 08:47:56

hrift是一个软件框架,用来进行可扩展且跨语言的服务的开发。它结合了功能强大的软件堆栈和代码生成引擎,以构建在 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, and OCaml

安装:

http://wiki.apache.org/thrift/ThriftInstallation

1. 依赖

yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel  
wget http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
tar zxvf thrift-0.9.
cd thrift-0.9.
./bootstrap.sh
./configure
make
make install

2. configure 可能如下错误

trhift configure: error: "Error: libcrypto requ...

解决方法:

安装 openssl openssl-devel (centOS)

#yum -y install openssl openssl-devel

# ./configure --prefix=/usr/local/thrift

3. 验证

thrift -version 

Thrift version 0.9.0

4. 安装扩展

http://pecl.php.net/get/libevent-0.1.0.tgz

extension=thrift_protocol.so
extension=libevent.so
extension=apc.so