前提:只支持64位系统

升级GCC:

https://github.com/jackywei/HOW-TO-BUILD-HHVM-WiKi/wiki/Build-&-Install-GCC4.6.3-in-CentOS-%285.2-&-6.3%29

安装CMake:

https://github.com/jackywei/HOW-TO-BUILD-HHVM-WiKi/wiki/Build-&-Install-CMake-2.8.10.2-in-CentOS6.3

升级boost:

https://github.com/jackywei/HOW-TO-BUILD-HHVM-WiKi/wiki/Build-&-install-Boost-1.50-in-CentOS-%28CentOS5.2-&-6.3-are-both-verified%29

备注:当boost上面方法不通,请用下面这个

./bootstrap.sh

./b2 install

之后参考:

https://github.com/facebook/hiphop-php/wiki/Building-and-installing-HHVM-on-CentOS-6.3

Building HipHop make 之后还需要

make install

完成之后运行hhvm 为执行单个PHP文件

可以启动WEB服务

配置参考:

    #日志配置
Log {
#日志等级
Level = None (default) | Error | Warning | Info | Verbose
# 使用@抑制错误是否后台日志启用错误记录
NoSilencer = false
#容许用户自己处理错误
AlwaysLogUnhandledExceptions = true
#PHP的错误等级
RuntimeErrorReportingLevel = 8191
#下面3个指定错误的格式及消息头(C++错误16进制,是否转换等)
Header = false
InjectedStackTrace = true
NativeStackTrace = true
#最大日志数量
MaxMessagesPerRequest = -1 #是否启用日志
UseLogFile = true
#日志文件
File = /usr/local/hiphop/log/server.log # 访问日志格式
AccessLogDefaultFormat = %h %l %u %t \"%r\" %>s %b
#日志格式
#Access {
# * {
# File = filename
# Format = some Apache access log format string
# }
#} # 管理后台日志
#AdminLog {
# File = filename
# Format = %h %t %s %U
#} # 是否启用 hphp_log() 来得到PHP代码的信息
ApplicationLog = true # 将错误分组,可以保存至数据库
# Log aggregator logs one line per several errors, grouped by error's
# stacktraces. It can also save errors to a specified database.
#Aggregator = false
#Aggregator {
# File = filename
# Database = [username[:password]@]server[:port][/database]
# SleepSeconds = 10 # polling cycle for aggregation
#} }
#错误处理
ErrorHandling {
CallUserHandlerOnFatals = true
NoInfiniteLoopDetection = false
NoInfiniteRecursionDetection = false
MaxStackDepth = 1000
ThrowBadTypeExceptions = false
ThrowNotices = false
NoticeFrequency = 1 # 1 out of these many notices to log
WarningFrequency = 1 # 1 out of these many warnings to log
AssertActive = false
AssertWarning = false
}
#资源限制
ResourceLimit {
CoreFileSize = 0 # in bytes
MaxSocket = 0
SocketDefaultTimeout = 5 # in seconds
MaxRSS = 0
MaxRSSPollingCycle = 0 # in seconds, how often to check max memory
DropCacheCycle = 0 # in seconds, how often to drop disk cache
} PidFile = /usr/local/hiphop/etc/server.pid # 进程PID文件 # $_SERVER['name'] = value
# 服务器变量
ServerVariables {
name = value
}
# 环境变量
# $_ENV['name'] = value
EnvVariables {
name = value
} # 服务器配置
Server {
#域名IP端口
Host = www.domain.com
IP = 0.0.0.0
Port = 80
#处理的线程数量
ThreadCount = 50
#代码根目录
SourceRoot = /var/www/www.domain.com/public_html
#共享代码目录,如加zf等框架引入等
#IncludeSearchPaths {
# * = some path
# * = another path
#}
#请求超时
RequestTimeoutSeconds = -1
#请求处理内存限制
RequestMemoryMaxBytes = -1 # 代码预加载,关闭
# Recommend to turn this on to avoid memory leaks and to enable warmup
# document features.
EnableMemoryManager = false # 显示内存问题,均在调试时候开启
# Only for debugging memory problems. When turned on, server will report
# SmartAllocator's usage for each thread to stdout.
CheckMemory = false # 多子域名
# If ServerName is not specified for a virtual host, use prefix + this
# suffix to compose one
#DefaultServerNameSuffix = default_domain.com
# Forcing $_SERVER['SERVER_NAME'] to come from request header
#ForceServerNameToHeader = false # 启动选项
# startup options
# TakeoverFilename = filename # for port takeover between server instances
# 默认文件
DefaultDocument = index.php
# 启动文件
#StartupDocument = filename
#WarmupDocument = filename
# 程序启动调用一个函数
#RequestInitFunction = function_name
#ThreadDocuments {
# * = somedoc.php
# * = another.php
#}
# 文件未找到处理文件
ErrorDocument404 = 404.php
#致命错误消息
FatalErrorMessage = some string #关闭选项
# shutdown options
GracefulShutdownWait = 0 # in seconds
HarshShutdown = true
EvilShutdown = true
DanglingWait = 0
}
AdminServer {
Port = 8088
ThreadCount = 1
Password = 123456
}
#静态内容
StaticFile {
Extensions {
bmp = image/bmp
}
Generators {
* = static_resource.php
}
}

出错:

unable to find/load systemlib.php

rm -rf /usr/local/bin/hhvm
#/usr/local/hiphop 为你的源码编译目录
ln -s /usr/local/hiphop/hphp/hhvm/hhvm /usr/local/bin/hhvm

如果接着报库文件找不到,请建立链接到/usr/local/lib目录即可

hhvm 中,部分php 函数不可用 ,如eval phpinfo等

配合nginx 使用

hiphop 配置

RewriteRules {
       * {
          pattern = ^.*$
          to = index.php
          qsa = yes
        }

}

nginx 配置

root /var/www/;location / {
        autoindex on;
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php;
    }
location ~ \.php$ {
        proxy_pass http://127.0.0.1:9000$request_uri;
}

hiphop-php 搭建 (CentOS)的更多相关文章

  1. 虚拟机搭建CentOS主机win10通过xshell连接

    目标:主机是win10系统,虚拟机搭建CentOS,在主机上通过XShell连接操作. 第一步 主机上安装虚拟机 第二步 下载CentOS 下载地址http://101.110.118.69/isor ...

  2. 环境搭建-CentOS集群搭建

    环境搭建-CentOS集群搭建 写在前面 最近有许多小伙伴问我,大数据的hadoop分布式集群该如何去搭建.所以,想着,就写一篇博客,帮助到更多刚入门大数据的人.本博客会一步一步带你实现一个Hadoo ...

  3. Hadoop环境搭建(centos)

    Hadoop环境搭建(centos) 本平台密码83953588abc 配置Java环境 下载JDK(本实验从/cgsrc 文件中复制到指定目录) mkdir /usr/local/java cp / ...

  4. hadoop集群搭建--CentOS部署Hadoop服务

    在了解了Hadoop的相关知识后,接下来就是Hadoop环境的搭建,搭建Hadoop环境是正式学习大数据的开始,接下来就开始搭建环境!我们用到环境为:VMware 12+CentOS6.4 hadoo ...

  5. 使用tomcat搭建centos的yum源

    最近在折腾大数据,需要搭建一个yum源.一般的做法是在CentOS中安装httpd,然后将rpm包放入/var/www/html下面,再执行[createrepo .]即可. 不过虚拟机对传文件终归是 ...

  6. 搭建CentOS 7本地源仓库

    CentOS 7离线包及其依赖 推荐使用yumdownloader --resolve --destdir=path python-pip,--resolve下载所有依赖,--destdir指定软件包 ...

  7. 本地局域网yum源搭建-centos/redhat

    环境-centos6.7  [本机yum搭建提前备好,不做介绍] [root@nagios ~]# cat /etc/redhat-release CentOS release 6.7 (Final) ...

  8. DELPHI搭建centos开发环境

    DELPHI搭建centos7开发环境 关闭防火墙 搭建开发环境,还是直接关闭LINUX防火墙,省事. 否则,使用到的网络端口号,都要在防火墙开放,麻烦. systemctl disable fire ...

  9. 局域网内搭建CentOS PHP 环境

    首先我们找到一台已经搭建好的CentOS,IP地址我就不说啦. 我们需要用到的几个工具,一个是SecureCRT用于远程连接,还有一个用于文件上传和下载就是filezilla 准备好了之后,我们就可以 ...

  10. Java开发环境搭建——CentOS配置

    普通用户添加到sudoers u切换到root visudo进入编辑,找到root  ALL=(ALL)    ALL,在后面加上myusername ALL=(ALL)  ALL 配置网络sudo ...

随机推荐

  1. Cheatsheet: 2014 03.01 ~ 03.31

    .NET Should I be concerned about PDB files? async and await -Simplified-Internals Web Performance tr ...

  2. ASP.NET API盘点

    1.控制只返回JSON一种数据 public class JsonContentNegotiator : IContentNegotiator { private readonly JsonMedia ...

  3. servlet&jsp高级:第五部分

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  4. [SAP ABAP开发技术总结]屏幕跳转

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  5. 关于Docker 常用命令

    Docker 常用命令 分类列一下常用的CLI命令 仓库相关 search/ pull / push / login etc. 例:docker pull ubuntu 从仓库下载ubuntuimag ...

  6. 泰信---->20131025~20131101(周计划安排)

    学习java相关知识计划安排: [前期复习阶段] (一)熟悉java相关语言基础. (二)搭建一个纯web项目工程,实现增加,删除,修改,查询以及分页...功能. (三)熟悉jboss的使用和相关配置 ...

  7. javascript学习-原生javascript的小特效(多个运动效果整理)

    以下代码就不详细解析了,在我之前的多个运动效果中已经解析好多次了,重复的地方这里就不说明了,有兴趣的童鞋可以去看看之前的文章<原生javascript的小特效> <!DOCTYPE ...

  8. mysql Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    错误原因:/var/lib/mysql目录中socket文件不存在.连接mysql服务器有两种方式:tcp连接,通过socket文件连接.通过socket文件,启动mysql服务,mysql服务会自动 ...

  9. 基础2 JVM

    1. 内存模型以及分区,需要详细到每个区放什么. //运行时数据区域 方法区 Method Area 各个线程共享的内存区域 存储已被虚拟机加载的类信息 常量 静态变量 即时编译器编译后的代码 虚拟机 ...

  10. Android控件之Button(按钮控件)和ImageButton(图片按钮控件)

    一.Button和ImageButton特证: 1.共同特证: 都可以作为一个按钮产生点击事件 2.不同特证: Button有text的属性,ImageButton没有 ImageButton有src ...