要求:CentOS 6.5 64位
1、下载HHVM
cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo
2、升级系统
sudo yum clean all
sudo yum install hhvm
sudo yum update hiphop-php
3、查看版本
hhvm –version
HipHop VM 3.0.1 (rel)
Compiler:
Repo schema: e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
4、安装nginx
sudo yum install nginx
5、修改配置文件
sudo cp -av /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.20140526
sudo vi /etc/nginx/conf.d/default.conf
修改
location / {
root /var/www/htdocs;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}
添加
location ~ \.php$ {
root /var/www/htdocs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
6、重启nginx
sudo /etc/init.d/nginx start
7、启动hhvm
sudo hhvm –mode server -vServer.Type=fastcgi -vServer.Port=9000
-
所有主机信息仅是为及时分享并收录,不做推荐!