编译方式(不推荐)
Update your CentOS first
第一步,永远是更新你的 yum
yum updateEnable the EPEL repository
安装EPEL源
yum install -y epel-releaseInstall some dependencies
安装依赖,有很多,直接复制粘贴即可
yum install cpp gcc-c++ cmake3 git psmisc {binutils,boost,jemalloc,numactl}-devel \
{ImageMagick,sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \
lib{xslt,event,yaml,vpx,png,zip,icu,mcrypt,memcached,cap,dwarf}-devel \
{unixODBC,expat,mariadb}-devel lib{edit,curl,xml2,xslt}-devel \
glog-devel oniguruma-devel ocaml gperf enca libjpeg-turbo-devel openssl-devel \
mariadb mariadb-server {fastlz,double-conversion,re2}-devel make -yOptional dependencies
可选依赖安装
yum install {fribidi,libc-client,glib2}-devel -yGet our hhvm
从github上获取hhvm
cd /tmp
git clone https://github.com/facebook/hhvm -b master hhvm --recursive
cd hhvmbuild
开始编译
# Okay let's go
cmake3 .
# Multithreads compiling
make -j$(($(nproc)+1))
# Compiled?
./hphp/hhvm/hhvm --version
# Install it
make install
# Final
hhvm --version
升级 g++ 到 4.9.*
有时候编译会遇到兼容问题:

centos 7 默认 g++ 是4.8版本,需要升级到4.9或者更高。

使用预编译包安装(推荐)
前期安装的东西都差不多
yum update -y
yum install -y epel-release安装依赖
yum install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc,numactl}-devel \
{ImageMagick,sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \
lib{xslt,event,yaml,vpx,png,zip,icu,mcrypt,memcached,cap,dwarf}-devel \
{unixODBC,expat,mariadb}-devel lib{edit,curl,xml2,xslt}-devel \
glog-devel oniguruma-devel ocaml gperf enca libjpeg-turbo-devel openssl-devel \
mariadb mariadb-server make libc-client -y
安装rpm HHVM
rpm -Uvh http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/hhvm-3.15.3-1.el7.centos.x86_64.rpm
更多版本选择http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/
HHVM --VERSION

赞赏支持
本文由 litblc 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Nov 27, 2017 at 06:16 pm

