Thrift is an open-source RPC framework contributed by FaceBook, a well-known SNS community. The entire process of compiling and installing Thrift in Ubuntu10.04 is recorded below. 1. Compile and install dependencies to install Java (unless you do not want RPC to use Java) add-apt-repository "debhttp: // archive.canonical.com/lucidpartner" apt-getupdateapt-ge
Thrift is an open-source RPC framework contributed by FaceBook, a well-known SNS community. The following describes how to compile and install Thrift in Ubuntu 10.04.
1. Compile and install Dependencies
Install Java (unless you do not want RPC to use Java)
Add-apt-repository "deb http://archive.canonical.com/lucid partner"
Apt-get update
Apt-get install sun-java6-jdk sun-java6-plugin
Compile and install MySQL (mainly for php5)
Wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.53.tar.gz/from/http://sunsite.informatik.rwth-aachen.de/mysql/
Tar-xzvf mysql-5.1.53.tar.gz
# Configuration
CFLAGS = "-O3" CXX = gcc CXXFLAGS = "-O3-felide-constructors-fno-exceptions-fno-rtti"
. /Configure-prefix =/usr/local/mysql-enable-starter er-with-unix-socket-path =/usr/local/mysql/tmp/mysql. sock-with-mysqld-ldflags =-all-static-with-client-ldflags =-all-static-with-extra-charsets = gb2312, gbk, utf8, latin1-without-debug-with-charset = utf8-with-collation = utf8_general_ci-with-pthread-enable-static-enable-thread-safe-client
# Compile and install
Make
Sudo make install
For other configurations, refer to: CentOS 5.4 compile and install MySQL see http://www.linuxidc.com/Linux/2011-12/50209.htm
Compile and install php (dev is required)
Sudo apt-get install php5-dev
2. Compile and install Thrift
I mainly need to support both C ++ and PHP. It is best to support Python.
Wget
Tar-xzvf
./Configure
Install the php support file separately.
Sudo mkdir-p/usr/share/php/Thrift
Cd/home/liheyuan/code/thrift-0.5.0/lib/php/src
Sudo cp-rf */usr/share/php5/Thrift/
3. Expand manual php Compilation
In fact, it can be used without expansion, but compilation expansion will provide good performance.
Cd ~ /Code/thrift-0.5.0/lib/php/src/ext/thrift_protocol
Phpize
./Configure-enable-thrift_protocol
Make
Sudo make install
You must also enable this feature in php ini.
Sudo vim/etc/php5/conf. d/thrift_protocol.ini
# Write
Extension = thrift_protocol.so
Supplement: configure is not required for php.
./Configure-prefix =/usr-without-ruby-without-haskell-without-python-without-perl-without-php-without-php_extension