Skip to content

Instantly share code, notes, and snippets.

@vxe
Last active September 6, 2018 10:15
Show Gist options
  • Save vxe/6812639 to your computer and use it in GitHub Desktop.
Save vxe/6812639 to your computer and use it in GitHub Desktop.
PHP hip-hop, will install and create in a directory called "dev". Actual executable is called hhvm and is located in dev/hiphop-php/hphp/hhvm
ansible-galaxy install -p ./roles -r roles.yml
#!/bin/bash
#set up directory structure;
mkdir -p $PWD/dev
git clone https://github.com/facebook/hiphop-php.git
cd $PWD/hiphop-php
# get dependencies
sudo apt-get install git-core cmake g++ libboost1.48-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-regex1.48-dev libboost-system1.48-dev \
libboost-program-options1.48-dev libboost-filesystem1.48-dev wget memcached \
libreadline-dev libncurses-dev libmemcached-dev libbz2-dev \
libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev \
libcloog-ppl0 libelf-dev libdwarf-dev subversion libunwind7-dev libnotify-dev
# set some environment variables
export CMAKE_PREFIX_PATH=`pwd`/..
export HPHP_HOME=`pwd`
cd ..
# get and configure libevent
git clone git://github.com/libevent/libevent.git
cd libevent
git checkout release-1.4.14b-stable
cat ../hiphop-php/hphp/third_party/libevent-1.4.14.fb-changes.diff | patch -p1
./autogen.sh
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..
# libcurl,
git clone git://github.com/bagder/curl.git
cd curl
./buildconf
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..
# Google glog
svn checkout http://google-glog.googlecode.com/svn/trunk/ google-glog
cd google-glog
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..
# Custom malloc, is this how they made php performant?
wget http://www.canonware.com/download/jemalloc/jemalloc-3.0.0.tar.bz2
tar xjvf jemalloc-3.0.0.tar.bz2
cd jemalloc-3.0.0
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..
# and now the actual build
cd hiphop-php
export HPHP_HOME=`pwd`
cmake .
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment