Welcome 微信登录

首页 / 操作系统 / Linux / 在Ubuntu下编译安装Thrift(支持php和c++)

Thrift是一个开源的RPC框架,由知名SNS社区FaceBook贡献。下面记录了在Ubuntu 10.04下编译安装Thrift的全过程。1、编译安装依赖安装Java(除非你不想RPC使用Java)add-apt-repository "deb http://archive.canonical.com/ lucid partner"apt-get updateapt-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#编译安装makesudo make install其他配置请参考:CentOS 5.4编译安装MySQL 见 http://www.linuxidc.com/Linux/2011-12/50209.htm编译安装php(一定要dev的)sudo apt-get install php5-dev2、编译安装Thrift我主要需要同时支持C++和PHP的,能支持Python最好wgettar -xzvf./configure还要单独安装php的支持文件sudo mkdir -p /usr/share/php/Thriftcd /home/liheyuan/code/thrift-0.5.0/lib/php/srcsudo cp -rf * /usr/share/php5/Thrift/3、手动编译php的拓展其实不用拓展也可以用,但是编译拓展的话性能会很好cd ~/code/thrift-0.5.0/lib/php/src/ext/thrift_protocolphpize./configure –enable-thrift_protocolmakesudo make install还要在php的ini中启用sudo vim /etc/php5/conf.d/thrift_protocol.ini#写入extension=thrift_protocol.so补充:不需要php时候的configure./configure –prefix=/usr –without-ruby –without-haskell –without-python –without-perl –without-php –without-php_extensionWindows环境下Thrift的安装、编译以及测试Ubuntu 11.10下nfs(Network File System)配置相关资讯      Thrift 
  • Ubuntu下thrift 0.9.3编译安装  (01月14日)
  • 服务开发框架 Thrift 0.9.1 发布  (08/22/2013 11:12:58)
  • 使用Java快速入门Thrift  (07/11/2012 09:11:20)
  • Thrift使用实例  (07/17/2014 15:47:41)
  • 在Linux(CentOS)上安装Thrift+  (12/18/2012 12:03:06)
  • Windows环境下Thrift的安装、编译  (12/25/2011 08:17:37)
本文评论 查看全部评论 (0)
表情: 姓名: 字数