Hip Hop

How-to: Install HipHop (PHP to C++ translator) 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. The following information about installing hiphop is provided by Facebook’s HipHop wiki.

Packages installation

Using sudo or as root user:

  1. 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</pre>

Getting HipHop source-code

  1. cd /home/user
  2. export CMAKE_PREFIX_PATH=/home/user
  3. mkdir hiphop
  4. cd hiphop
  5. git clone git://github.com/facebook/hiphop-php.git
  6. cd hiphop-php
  7. export CMAKE_PREFIX_PATH=`/bin/pwd`/../
  8. export HPHP_HOME=`/bin/pwd`
  9. export HPHP_LIB=`/bin/pwd`/bin
  10. git submodule init
  11. git submodule update
  12. cd ..

Building third-party libraries

libevent

  1. wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
  2. tar -xzvf libevent-1.4.13-stable.tar.gz
  3. cd libevent-1.4.13-stable
  4. cp ../hiphop-php/src/third_party/libevent.fb-changes.diff .
  5. patch p1 &lt; libevent.fb-changes.diff
  6. ./configure --prefix=$CMAKE_PREFIX_PATH
  7. make
  8. make install
  9. cd ..

ICU4

  1. wget http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz
  2. tar -xvzf icu4c-4_2_1-src.tgz
  3. cd icu/source
  4. ./configure --prefix=$CMAKE_PREFIX_PATH
  5. make
  6. make install
  7. cd ../../

libmemcached

  1. wget http://launchpad.net/libmemcached/1.0/0.44/+download/libmemcached-0.44.tar.gz
  2. ./configure --prefix=$CMAKE_PREFIX_PATH
  3. make
  4. make install
  5. cd ..

libCurl

Make sure that your system time is correct, otherwise ./configure will fail.

  1. wget http://curl.haxx.se/download/curl-7.20.0.tar.gz
  2. tar -xvzf curl-7.20.0.tar.gz
  3. cd curl-7.20.0
  4. cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
  5. patch -p1 &lt; libcurl.fb-changes.diff
  6. ./configure --prefix=$CMAKE_PREFIX_PATH
  7. make
  8. make install
  9. cd ..

Building HipHop

  1. cd hiphop-php
  2. cmake .
  3. make

Now, we have successfully compiled HipHop!

source: http://wiki.github.com/facebook/hiphop-php/building-and-installing

 

Hessen Kasselstraat 8
5615 SM Eindhoven
phone: +316-81888456