无法让 hhvm 与 nginx 一起工作
unable to get hhvm working with nginx
我安装了 nginx 和 hhvm,并且 运行 作为 ubuntu VM 上的进程。配置复制如下。我在 /usr/share/nginx/html 中有一个 index.php 文件(由 nginx 指向)但是当我尝试访问由 nginx 服务的网站时,我收到以下关于 hhvm 的错误:
/var/log/nginx/error.log
2016/10/04 12:03:05 [crit] 12443#0: *1 connect() to unix:/var/run/hhvm/hhvm.sock failed (2: No such file or directory) while connecting to upstr
eam, client: xx.xxx.xxx.xxx, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/hhvm/hhvm.sock:", host: "xx.xx.xx.xx"
Nginx 配置(部分配置)
server {
listen 80 default_server;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
index index.php;
try_files $uri $uri/ $uri/index.php$args /index.php$args;
}
location /mysql {
index index.php;
}
location ~* \.(php)$ {
try_files $uri = 404;
location ~ \..*/.*\.php$ {return 404;}
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
我检查过 - nginx 和 hhvm 进程都是 运行。关于如何进一步解决此问题的任何想法?
更新:
我将 /etc/hhvm 中的 server.ini 文件更改为以下内容并重新启动了服务,但它似乎没有完成工作
hhvm.server.file.socket=/var/run/hhvm/hhvm.sock
我注释掉了之前使用的9000端口。
更新:
进行 server.init 更改并重新启动 hhvm 后,我在 /var/log/hhvm/error.log 中收到以下错误:
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to start page server
Shutting down due to failure(s) to bind in HttpServer::runAndExitProcess
/var/run/hhvm 目录归 www-data
所有
我在端口 9000 上结束了 运行 hhvm 并将 nginx (fasgcgi_pas) 指向该端口(而不是使用文件套接字选项)。
我安装了 nginx 和 hhvm,并且 运行 作为 ubuntu VM 上的进程。配置复制如下。我在 /usr/share/nginx/html 中有一个 index.php 文件(由 nginx 指向)但是当我尝试访问由 nginx 服务的网站时,我收到以下关于 hhvm 的错误:
/var/log/nginx/error.log
2016/10/04 12:03:05 [crit] 12443#0: *1 connect() to unix:/var/run/hhvm/hhvm.sock failed (2: No such file or directory) while connecting to upstr
eam, client: xx.xxx.xxx.xxx, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/hhvm/hhvm.sock:", host: "xx.xx.xx.xx"
Nginx 配置(部分配置)
server {
listen 80 default_server;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
index index.php;
try_files $uri $uri/ $uri/index.php$args /index.php$args;
}
location /mysql {
index index.php;
}
location ~* \.(php)$ {
try_files $uri = 404;
location ~ \..*/.*\.php$ {return 404;}
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
我检查过 - nginx 和 hhvm 进程都是 运行。关于如何进一步解决此问题的任何想法?
更新: 我将 /etc/hhvm 中的 server.ini 文件更改为以下内容并重新启动了服务,但它似乎没有完成工作
hhvm.server.file.socket=/var/run/hhvm/hhvm.sock
我注释掉了之前使用的9000端口。
更新: 进行 server.init 更改并重新启动 hhvm 后,我在 /var/log/hhvm/error.log 中收到以下错误:
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
Unable to start page server
Shutting down due to failure(s) to bind in HttpServer::runAndExitProcess
/var/run/hhvm 目录归 www-data
所有我在端口 9000 上结束了 运行 hhvm 并将 nginx (fasgcgi_pas) 指向该端口(而不是使用文件套接字选项)。