http://www.ooso.net/archives/543
Building and Installing on Ubuntu 9.10
HipHop has been developed on CentOS and Fedora, building on Ubuntu 9.10 is experimental.
At the moment, HipHop can only run on 64 bits systems.
Packages installation
Using sudo or as root user:
sudo apt-get install git-core cmake g++ libboost-dev flex bison re2c libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev git-core autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev
Getting HipHop source-code
mkdir hiphop
cd hiphop
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
git submodule init
git submodule update
cd ..
Building third-party libraries
libevent
wget http://www.monkey.org/~provos/libevent- ... ble.tar.gz
tar -xzvf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
cp ../hiphop-php/src/third_party/libevent.fb-changes.diff .
patch < libevent.fb-changes.diff
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..
ICU4
wget http://download.icu-project.org/files/i ... _1-src.tgz
tar -xvzf icu4c-4_2_1-src.tgz
cd icu/source
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ../../
libCurl
Make sure that your system time is correct, otherwise ./configure will fail.
wget http://curl.haxx.se/download/curl-7.20.0.tar.gz
tar -xvzf curl-7.20.0.tar.gz
cd curl-7.20.0
cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
patch -p0 < libcurl.fb-changes.diff
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..
Building HipHop
cd hiphop-php
cmake .
HipHop PHP facebook 將PHP 轉成C++
HipHop building on Ubuntu 11.10
http://scar.simcz.tw/article/2012/03/07 ... ntu-11-10/
最近有個專案有機會用到Facebook所提出的HipHop for PHP,它可以將PHP程式碼轉為C++並編譯成可執行檔用來加速處理效能,在這邊筆記一下安裝過程。
refrence: Building and Installing on Ubuntu 11.10
先將系統的編譯環境用apt安裝好
1sudo apt-get install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl build-essential 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 libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev libcloog-ppl0
接著從GitHub將hiphop-php clone下來
1mkdir dev
2cd dev
3git clone git://github.com/facebook/hiphop-php.git
4cd hiphop-php
5export CMAKE_PREFIX_PATH=`/bin/pwd`/../
6export HPHP_HOME=`/bin/pwd`
7export HPHP_LIB=`/bin/pwd`/bin
8cd ..
編譯第三方Libraries
libevent
1wget http://www.monkey.org/~provos/libevent- ... ble.tar.gz
2tar -xzvf libevent-1.4.14b-stable.tar.gz
3cd libevent-1.4.14b-stable
4cp ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff .
5patch -p1 < libevent-1.4.14.fb-changes.diff
6./configure --prefix=$CMAKE_PREFIX_PATH
7make
8make install
9cd ..
libdurl
1wget http://curl.haxx.se/download/curl-7.21.2.tar.gz
2tar -xvzf curl-7.21.2.tar.gz
3cd curl-7.21.2
4cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
5patch -p1 < libcurl.fb-changes.diff
6./configure --prefix=$CMAKE_PREFIX_PATH
將以下兩的檔案用連結中的檔案置換掉
curl-7.21.2/lib/ssluse.c
hiphop-php/src/runtime/ext/extension.cpp
1rm "$CMAKE_PREFIX_PATH"/curl-7.21.2/lib/ssluse.c
2wget https://raw.github.com/bagder/curl/26b4 ... b/ssluse.c -O "$CMAKE_PREFIX_PATH"/curl-7.21.2/lib/ssluse.c
rm "$HPHP_HOME"/src/runtime/ext/extension.cpp
3wget https://raw.github.com/h4ck3rm1k3/hipho ... ension.cpp -O "$HPHP_HOME"/src/runtime/ext/extension.cpp
4
5make
6make install
7cd ..
libmemcacheed
1wget http://launchpad.net/libmemcached/1.0/0 ... .49.tar.gz
2tar -xzvf libmemcached-0.49.tar.gz
3cd libmemcached-0.49
4./configure --prefix=$CMAKE_PREFIX_PATH
5make
6make install
7cd ..
開始編譯hiphop-php
1cd hiphop-php
2git submodule init
3git submodule update
4cmake .
5make
到這邊就算完成Hiphop的編譯了,接下來是設定環境變數,可以寫到/etc/profile, ~/.bashrc或在~/.zshrc
1export HPHP_HOME=your_path/dev/hiphop-php
2export HPHP_LIB=$HPHP_HOME/bin
3export CMAKE_PREFIX_PATH=$HPHP_HOME/../
4export PATH=$PATH:$HPHP_HOME/src/hphp:$HPHP_HOME/src/hphpi
最近有個專案有機會用到Facebook所提出的HipHop for PHP,它可以將PHP程式碼轉為C++並編譯成可執行檔用來加速處理效能,在這邊筆記一下安裝過程。
refrence: Building and Installing on Ubuntu 11.10
先將系統的編譯環境用apt安裝好
1sudo apt-get install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl build-essential 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 libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev libcloog-ppl0
接著從GitHub將hiphop-php clone下來
1mkdir dev
2cd dev
3git clone git://github.com/facebook/hiphop-php.git
4cd hiphop-php
5export CMAKE_PREFIX_PATH=`/bin/pwd`/../
6export HPHP_HOME=`/bin/pwd`
7export HPHP_LIB=`/bin/pwd`/bin
8cd ..
編譯第三方Libraries
libevent
1wget http://www.monkey.org/~provos/libevent- ... ble.tar.gz
2tar -xzvf libevent-1.4.14b-stable.tar.gz
3cd libevent-1.4.14b-stable
4cp ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff .
5patch -p1 < libevent-1.4.14.fb-changes.diff
6./configure --prefix=$CMAKE_PREFIX_PATH
7make
8make install
9cd ..
libdurl
1wget http://curl.haxx.se/download/curl-7.21.2.tar.gz
2tar -xvzf curl-7.21.2.tar.gz
3cd curl-7.21.2
4cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
5patch -p1 < libcurl.fb-changes.diff
6./configure --prefix=$CMAKE_PREFIX_PATH
將以下兩的檔案用連結中的檔案置換掉
curl-7.21.2/lib/ssluse.c
hiphop-php/src/runtime/ext/extension.cpp
1rm "$CMAKE_PREFIX_PATH"/curl-7.21.2/lib/ssluse.c
2wget https://raw.github.com/bagder/curl/26b4 ... b/ssluse.c -O "$CMAKE_PREFIX_PATH"/curl-7.21.2/lib/ssluse.c
rm "$HPHP_HOME"/src/runtime/ext/extension.cpp
3wget https://raw.github.com/h4ck3rm1k3/hipho ... ension.cpp -O "$HPHP_HOME"/src/runtime/ext/extension.cpp
4
5make
6make install
7cd ..
libmemcacheed
1wget http://launchpad.net/libmemcached/1.0/0 ... .49.tar.gz
2tar -xzvf libmemcached-0.49.tar.gz
3cd libmemcached-0.49
4./configure --prefix=$CMAKE_PREFIX_PATH
5make
6make install
7cd ..
開始編譯hiphop-php
1cd hiphop-php
2git submodule init
3git submodule update
4cmake .
5make
到這邊就算完成Hiphop的編譯了,接下來是設定環境變數,可以寫到/etc/profile, ~/.bashrc或在~/.zshrc
1export HPHP_HOME=your_path/dev/hiphop-php
2export HPHP_LIB=$HPHP_HOME/bin
3export CMAKE_PREFIX_PATH=$HPHP_HOME/../
4export PATH=$PATH:$HPHP_HOME/src/hphp:$HPHP_HOME/src/hphpi