我按照https://github.com/hhvm/hack-example-site上的说明进行操作,但在通过 ubunut 14.04 在 ngnix 上设置 hhvm hack 站点时不知何故迷路了。请注意,我为 14.04 使用了适当的 apt-get repo。
但是,在配置并尝试访问 127.0.0.1:9000 后,我在 /var/log/hhvm/error.log 中看到一个错误
FastCGI protocol: received an invalid record
我的 /etc/ngnix/sites-enabled 如下
-rw-r--r-- 1 root root 0 Aug 30 22:01 default
lrwxrwxrwx 1 root root 44 Aug 30 22:21 hack-example-site -> /etc/nginx/sites-available/hack-example-site
/etc/ngnix/sites-available/hack-example-site 的内容如下:
server {
root ~/hack-example-site/hack-example-site;
index index.php;
location ~ \.php$ {
# If fastcgi backend is on another server disable this.
# Read issue #6 about this
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME ~/hack-example-site/hack-example-site/index.php
fastcgi_param ~/hack-example-site/hack-example-site $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
有人可以帮助我在我的本地主机上运行这个 hhvm 站点吗?谢谢。
哦,请注意 ngnix 已正确安装并且服务器响应 localhost。
配置文件 /etc/nginx/sites-available/hack-example-site 如下:
server {
root /root/hack-example-site;
index index.php;
server_name localhost;
location ~ \.php$ {
# If fastcgi backend is on another server disable this.
# Read issue #6 about this
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME ~/hack-example-site/hack-example-
网站/index.php
fastcgi_param /root/hack-example-site
$document_root$fastcgi_script_name;
include fastcgi_params;
} } ~