`
landyer
  • 浏览: 144535 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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

阅读更多

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

 

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

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

#相关代码, [四号程序员] http://www.coder4.com
add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update
apt-get install sun-java6-jdk sun-java6-plugin

编译安装MySQL(主要是为了php5)

#相关代码, [四号程序员] http://www.coder4.com
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的)

#相关代码, [四号程序员] http://www.coder4.com
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
分享到:
评论

相关推荐

    windows下vs2010编译的thrift,包含lib和cpp源码

    在Windows下使用VS2010编译Thrift涉及以下步骤: 1. 安装VS2010和必要的构建工具。 2. 下载Thrift源码,包括thrift-0.11.0版本。 3. 配置项目设置,指定编译目标为C++和Windows。 4. 修改和配置编译选项,确保与你...

    Apache Thrift 使用说明

    在安装完成后,可以在 `/usr/local/include/thrift` 和 `/usr/local/lib` 目录下找到头文件和库文件,而在 `/usr/local/bin` 中会有 `thrift` 可执行程序。Thrift 的安装还依赖于 boost 库,通常位于 `/usr/include/...

    thrift安装

    在编译Thrift之前,确保你的系统已经安装了必要的依赖库,这通常包括C++编译器(如GCC或Clang),Boost库,以及Autotools(autoconf、automake、libtool)。对于不同的操作系统,安装方法略有差异,例如在Ubuntu/...

    linux下安装和测试thrift

    在安装完成后,为了确认Thrift已经成功安装,你可以通过运行`thrift --version`来查看其版本信息。 现在,我们来测试Thrift。Thrift支持多种语言的生成代码,比如Python、Java、C++等。这里以Python为例,创建一个...

    Thrift的安装方法和简单实例

    Thrift 允许开发者通过接口定义语言(IDL)来定义服务,然后自动生成相应的客户端和服务端代码,支持多种编程语言,包括 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, ...

    Hadoop Hue 3.9.0详细安装文档.pdf

    在安装Hue前,需要安装一些操作系统级别的依赖包,这通常包括编译工具、Python库和库文件。在Ubuntu上,可以使用以下命令安装: ```bash sudo apt-get update sudo apt-get install -y build-essential openjdk-8-...

    scribe详细安装文档

    在安装scribe之前,我们需要确保以下软件已经安装: 1. **Python**: scribe是用Python编写的,所以需要Python 2.7或更高版本。 2. **Boost**: scribe依赖于Boost库,用于C++编程。 3. **Thrift**: Thrift是Facebook...

Global site tag (gtag.js) - Google Analytics