在Ubuntu下编译安装Thrift(支持php和c++)

原文地址:http://www.coder4.com/archives/1188

Thrift是一个开源的RPC框架,由知名SNS社区FaceBook贡献。下面记录了在Ubuntu 10.04下编译安装Thrift的全过程。

1、编译安装依赖安装Java(除非你不想RPC使用Java)

add-apt-repository "deb <a href="http://archive.canonical.com/" style="color: #ff9e7b !important; text-decoration: none; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-color: initial !important; float: none !important; height: auto !important; line-height: 1.1em !important; text-align: left !important; vertical-align: baseline !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; padding: 0px !important; margin: 0px !important;">http://archive.canonical.com/</a> lucid partner"
apt-get update
apt-get install sun-java6-jdk sun-java6-plugin

编译安装MySQL(主要是为了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
#配置
CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
./configure --prefix=/usr/local/mysql --enable-assembler --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
#编译安装
make
sudo make install

其他配置请参考:CentOS 5.4编译安装MySQL编译安装php(一定要dev的)

display: table-cell; vertical-align: baseline !important; text-align: left !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-color: initial !important; float: none !important; height: auto !important; line-height: 1.1em !important; width: 721px; f

相关推荐