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 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).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?