无法让hhvm使用nginx

时间:2016-10-04 12:16:44

标签: php nginx hhvm

我已经在ubuntu VM上安装并运行了nginx和hhvm作为进程。配置文件复制如下。我在/ usr / share / nginx / html(由nginx指向)中有一个index.php文件但是当我尝试访问由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

拥有

1 个答案:

答案 0 :(得分:1)

我最终在端口9000上运行hhvm并指向nginx(fasgcgi_pas)指向端口(而不是使用文件套接字选项)。

相关问题