海运的博客

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

分类
最新文章
最近回复
  • xiongrui: 看图
  • 傻狍子: filebrowser好像和这功能一样? https://github.com/filebro...
  • 陶国文: 想看看能不能安装
  • 傻狍子: 服务端设置了用户名密码认证的话,在openwrt的openvpn客户端的配置文件当中该如何更改...
  • 王阴阳师: 感谢,一点不啰嗦,还很管用!
  • simon: 刚刚看了我的vps,玛德,居然也有人在一直尝试登录,幸好我的密码是强密码
  • thornbird: 又学会一招,不错
  • 头很黑: 除了发送eth转账 ,还能转账其他的代币吗 比如eos
  • 米扑博客: 总结的很棒
  • 米扑博客: 很赞的博客