...
- Install git and build dependencies:
No Format sudo apt-get install 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 distcc git-core dpkg-dev debhelper autotools-dev autoconf libtool \ libcurl4-openssl-dev libboost-program-options-dev libboost-filesystem-dev libboost-system-dev
Create a working directory:
No Format mkdir hiphop cd hiphop export HIPHOP=`pwd`
Get the source:
No Format git clone git://github.com/facebook/hiphop-php cd hiphop-php git submodule init git submodule update cd ..
Get and build the patched
libevent
:No Format wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz tar xzf libevent-*-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 make make install prefix=$HIPHOP cd ..
Get and build
libicu
4.2:No Format wget http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz tar xzf icu4c-*-src.tgz cd icu/source ./configure make make install prefix=$HIPHOP cd ../../
Get and build the patched
curl
:No Format wget http://curl.haxx.se/download/curl-7.20.0.tar.gz tar xzf curl-*.tar.gz cd curl-7.20.0 cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff . patch -p1 < libcurl.fb-changes.diff ./configure make make install prefix=$HIPHOP cd ..
Build HipHop:
No Format cd hiphop-php export CMAKE_PREFIX_PATH=$HIPHOP export HPHP_HOME=`pwd` export HPHP_LIB=`pwd`/lib
No Format cmake . make
* If
cmake
fails, run the following to empty the cache before trying again:No Format rm CMakeCache.txt
- Test HipHop.
From the shell:
No Format cd .. echo "Hello, world." > test.php hiphop-php/src/hphp/hphp test.php --keep-tempdir=1 --log=3 --output-dir=$HIPHOP/test-build test-build/program -m server -p 8080
- From a browser or other HTTP client, visit
http://localhost:8080/test.php
- Output should consist of "Hello, world."
- From the shell, press
Ctrl-C
.
...
Warning |
---|
These directions are a work in progress. |
Install Bazaar:
No Format sudo apt-get install bzr
Go into the HipHop directory:
No Format cd $HIPHOP mkdir pressflow-build
Check out Pressflow from the Hip Hop compatibility branch and make it the working directory:
No Format bzr checkout lp:pressflow/6.x-hiphop cd 6.x-hiphop
Generate includes:
No Format find . -name "*.php" > ../pressflow-build/files.list find . -name "*.inc" | grep -v "\.pgsql\.inc" | grep -v "\.mysql\.inc" >> ../pressflow-build/files.list find . -name "*.module" >> ../pressflow-build/files.list find . -name "*.install" >> ../pressflow-build/files.list find . -name "*.profile" >> ../pressflow-build/files.list
Build the system:
No Format $HIPHOP/hiphop-php/src/hphp/hphp --input-list=$HIPHOP/pressflow-build/files.list --keep-tempdir=1 \ --log=3 --include-path="." --force=1 -v "AllDynamic=true" --output-dir=$HIPHOP/pressflow-build
- Fix everything, rebuild.
Launch the server:
No Format ../pressflow-build/program -m server -p 8080 -v "Server.SourceRoot=`pwd`" -v "Server.DefaultDocument=index.php" -c $HIPHOP/hiphop-php/bin/mime.hdf
...