nginx502错误 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory)

访问html,txt文件正常,但是访问php文件报502;

nginx日志报错

 

 其中,我的是enable-php.conf文件

      location ~ [^/]\.php(/|$)
        {
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

改为

        location ~ [^/]\.php(/|$)
        {
            try_files $uri =404;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

 

posted @ 2021-06-10 15:45  zhang_you_wu  阅读(2197)  评论(0编辑  收藏  举报