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

nginx日志报错

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

 

 其中,我的是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;
        }

 

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-08-08
  • 2022-12-23
相关资源
相似解决方案