HipHop PHP在Ubuntu上安装和使用

HipHop PHP是facebook的一个开源项目,facebook 90%的流量由它支撑 ,简单的说HipHop PHP是把PHP语言转化成高度优化的C++程序,通过g++编译。目前只支持Linux 和FreeBSD。
hiphop php 中国
HipHop PHP Wiki : http://en.wikipedia.org/wiki/HipHop_for_PHP
安装步骤:
1.安装依赖包
sudo apt-get install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev wget memcached libreadline-dev libncurses-dev libmemcached-dev libicu-dev libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev
2.获取HipHop源码包
mkdir dev
cd dev
git clone git://github.com/facebook/hiphop-php.git
cd hiphop-php
export CMAKE_PREFIX_PATH=`/bin/pwd`/../
export HPHP_HOME=`/bin/pwd`
export HPHP_LIB=`/bin/pwd`/bin
cd ..

3.安装第三方库
1) libevent
wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar -xzvf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
cp ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff .
patch -p1 ./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

2) libCurl
确保系统时间正确,否则 ./configure 会出错.
wget http://curl.haxx.se/download/curl-7.21.2.tar.gz
tar -xvzf curl-7.21.2.tar.gz
cd curl-7.21.2
cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
patch -p1 ./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

3) libmemcached
wget http://launchpad.net/libmemcached/1.0/0.49/+download/libmemcached-0.49.tar.gz
tar -xzvf libmemcached-0.49.tar.gz
cd libmemcached-0.49
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

4.安装HipHop PHP

cd hiphop-php
git submodule init
git submodule update
cmake .
make

taxonomy:

评论

这种应该应该是大级别的,暂时用不上

对动态的 社交的网站 十分有用, 因为十分依赖php计算, drupal一个页面请求,php代码在30M左右, 计算量惊人。 作者能进一步做一个 hiphop for php 下的drupal 部署和测试,就完美了