海运的博客

Centos6安装HHVM

发布时间:September 24, 2014 // 分类:HHVM // No Comments

安装源:

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
cd /etc/yum.repos.d
wget http://www.hop5.in/yum/el6/hop5.repo

安装HHVM:

yum install hhvm --setopt=protected_multilib=false
关闭多版本检查,libgcc i686版本冲突
--setopt=protected_multilib=false

HHVM集成的PHP扩展:
https://github.com/facebook/hhvm/wiki/Extensions

JIT编译器HHVM提升PHP性能

发布时间:December 26, 2013 // 分类:HHVM // No Comments

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

分类
最新文章
最近回复
  • 404NTF: 交叉编译的作用是?
  • 404NTF: 请教一下 CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go ...
  • 小智: 安利个PHP开发以太坊区块链的教程: http://xc.hubwiz.com/course/...
  • 陈浩南: 您好,您教程中的 dev.openwrt.org.cn 现在似乎不可用了。请问现在应该在哪里下...
  • 斑马斑马: 怎么查看虚拟机CPU 内存使用情况
  • zzg: http://downloads.openwrt.org.cn/PandoraBox/rali...
  • xiongrui: 看图
  • 傻狍子: filebrowser好像和这功能一样? https://github.com/filebro...
  • 陶国文: 想看看能不能安装
  • 傻狍子: 服务端设置了用户名密码认证的话,在openwrt的openvpn客户端的配置文件当中该如何更改...
页面执行耗时:0.0328秒。-->