Nginx+php7 502 Bad Gateway

 时间:2026-02-14 00:36:34

1、首先查找php-fpm位置:

1.find / -name php-fpm;

2.查看listen值;

Nginx+php7 502 Bad Gateway

2、打开nginx配置文件,查看fastcgi_pass配置项值;

fastcgi_pass   127.0.0.1:9000;

Nginx+php7 502 Bad Gateway

3、使用grep查看 php-fpm是否运行;

1.netstat -ant | grep 9000

2.结果为空,说明php-fpm未运行;


Nginx+php7 502 Bad Gateway

4、因此,将nginx配置文件中fastcgi_pass配置项改为 unix:/tmp/php-cgi.sock;

fastcgi_pass unix:/tmp/php-cgi.sock;

Nginx+php7 502 Bad Gateway

5、保存,并重启nginx;

/usr/local/nginx/sbin/nginx -s reload

Nginx+php7 502 Bad Gateway

6、再次访问,运行成功!!

Nginx+php7 502 Bad Gateway

  • JetBrains IntelliJ IDEA 2019 安装教程
  • ASP.NET怎么创建一个项目(具体步骤)
  • 图解使用Navicat for MySQL创建存储过程
  • Eclipse 配置项目的Java环境
  • 【精】超简单MyEclipse汉化来啦!!!!!!!
  • 热门搜索
    章丘旅游景点大全 特价旅游团 塞舌尔旅游攻略 吕梁旅游景点大全 长沙的旅游景点 烟台旅游政务网首页 山东清明节旅游好去处 罗平旅游景点 三清山旅游网 旅游卫视大驾光临