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

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

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?