我在ubuntu虚拟机上安装了nginx和hhvm并作为进程运行。下面复制了配置。我在/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 config (part of config)
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端口。
更新:制作服务器后。init change并重启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)指向端口(而不是使用文件套接字选项)。