dscpg80066
dscpg80066
2016-10-04 12:16
浏览 74
已采纳

无法让hhvm使用nginx

I have nginx and hhvm installed and running as processes on a ubuntu VM. The configs are copied below. I have an index.php file in /usr/share/nginx/html (pointed to by nginx) but when I try to access the site beign served by nginx, I get the following error about 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;
    }

I have checked - bothh nginx and hhvm processes are running. Any thoughts on how to troubleshoot this further?

Update: I changed the server.ini file in /etc/hhvm to the following and restarted the service but it does not appear to have done the job

hhvm.server.file.socket=/var/run/hhvm/hhvm.sock

I commented out the 9000 port being used previously.

Update: After making the server.init change and restarting hhvm, I get the following error in /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

The /var/run/hhvm directory is owned by www-data

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douji6940
    douji6940 2016-10-04 18:12
    已采纳

    I ended up running hhvm on port 9000 and pointed nginx (fasgcgi_pas) to point to the port (instead of using the file socket option).

    点赞 评论

相关推荐