Building and installing HHVM on RHEL 7

orcuspl edited this page Apr 27, 2016 · 4 revisions

We are not using sudo in this guide. Do it yourself or just be root here, for a short while.


Make sure that you have rhel-7-server-optional-rpms repository enabled as several of the required packages are there.

subscription-manager repos --enable=rhel-7-server-optional-rpms

Packages for building

yum install git svn cpp make autoconf automake libtool patch memcached \
bzip2 gcc-c++ cmake wget boost-devel mysql-devel pcre-devel gd-devel \
libxml2-devel expat-devel libicu-devel bzip2-devel openldap-devel \
libedit-devel libcap-devel binutils-devel pam-devel elfutils-libelf-devel \
libcurl-devel libmemcached-devel tbb-devel libdwarf-devel \
ImageMagick-devel libxslt-devel ocaml libevent-devel libyaml-devel \
readline-devel libzip-devel sqlite-devel gmp-devel gperf

Some of the packages are not found in RHEL repositories, so you need to install them from sources yourself.

Google Glog

cd /opt
wget &&
tar xvzf glog-0.3.3.tar.gz && cd glog-0.3.3 &&
./configure && make && make install


cd /opt
wget &&
tar xvzf onig-5.9.5.tar.gz && cd onig-5.9.5 &&
./configure && make && make install


cd /opt
wget &&
tar xvzf onig-5.9.6.tar.gz && cd onig-5.9.6 &&
./configure && make && make install


cd /opt
wget &&
tar zxvf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8 &&
./configure && make && make install


cd /opt
wget &&
tar jxvf jemalloc-3.6.0.tar.bz2 && cd jemalloc-3.6.0 &&
./configure && make && make install


cd /opt
wget &&
tar zxvf r124.tar.gz && cd lz4-r124 &&
make && make install PREFIX=/usr/local

Getting HHVM source code and building

cd /opt
git clone git:// --depth=1
export CMAKE_PREFIX_PATH=`pwd`
cd hhvm
git submodule update --init --recursive
cmake .
make # Add -jN, with N being numcores+1 to maximize build performance.
make install

RHEL Service Daemon

To have HHVM start as a system daemon process on RHEL once you have complied HHVM you will want to create an HHVM service. Below you will find an example of a systemd file. This will allow you to start HHVM as a daemon by issuing service start and stop commands and enable HHVM to be run on boot.

Please note a config file needs to exist at /etc/hhvm/server.ini, and username for HHVM is nginx or apache depending on which http server you have installed. This can be changed in the /usr/lib/systemd/system/hhvm.service script file to match your setup.


Description=HipHop Virtual Machine

ExecStart=/usr/local/bin/hhvm -m daemon -u nginx -c /etc/hhvm/server.ini
ExecStop=rm /var/run/


Start HHVM

systemctl start hhvm

Enable HHVM on boot

systemctl enable hhvm
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.