Debian7下安装:
echo 'deb http://dl.hhvm.com/debian wheezy main' >> /etc/apt/sources.list.d/hhvm.list
apt-get update
apt-get install hhvm
运行于Server模式:
Server {
Port = 80
ExposeHPHP = false
SourceRoot = /var/www
}
Eval {
Jit = true
JitWarmupRequests=0
}
Log {
Level = Error
UseLogFile = true
File = /var/log/hhvm/error.log
Access {
* {
File = /var/log/hhvm/access.log
Format = %h %l %u %t \"%r\" %>s %b
}
}
}
VirtualHost {
* {
Pattern = .*
RewriteRules {
dirindex {
pattern = ^/(.*)/$
to = $1/index.php
qsa = true
}
}
}
}
StaticFile {
FilesMatch {
* {
pattern = .*\.(dll|exe)
headers {
* = Content-Disposition: attachment
}
}
}
Extensions {
css = text/css
gif = image/gif
html = text/html
jpe = image/jpeg
jpeg = image/jpeg
jpg = image/jpeg
png = image/png
tif = image/tiff
tiff = image/tiff
txt = text/plain
}
}
运行于Fastcgi模式:
Server {
Port = 9000
Type=fastcgi
ExposeHPHP = false
}
Eval {
Jit = true
JitWarmupRequests=0
}
Log {
Level = Error
UseLogFile = true
File = /var/log/hhvm/error.log
Access {
* {
File = /var/log/hhvm/access.log
Format = %h %l %u %t \"%r\" %>s %b
}
}
}
启动HHVM:
hhvm -m daemon --config server.hdf
默认请求超过11次才启动JIT模式,修改为立即启动为JIT模式。
JitWarmupRequests=0
CLI:
hhvm -v "Eval.Jit=true" f.php
集成的扩展:https://github.com/facebook/hhvm/wiki/Extensions
性能提升多少?看测试脚本:https://github.com/ckwalsh/php_hhvm_bench