Compile and install Thrift in Ubuntu (php and c ++ are supported)

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.