我按照https://github.com/hhvm/hack-example-site处的说明进行操作,并且在通过ubunut 14.04在ngnix上设置hhvm hack网站时迷路了。请注意,我使用了适当的apt-get repo for 14.04。
但是在配置并尝试访问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;
} } 〜
答案 0 :(得分:0)
/etc/ngnix/sites-enabled/default->/etc/ngnix/sites-available/default.
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
#index index.html index.htm;
index test.php;
# Make site accessible from http://localhost/
server_name localhost;
include hhvm.conf;