Nginx服务器网站打开之后出现:
1 2 |
502 Bad Gateway nginx |
经测试,是php的问题,首先看一下使用的php版本
然后测试该版本php是否启动:
1 2 3 4 5 |
(base) mcj@mcj2080:/usr/include$ service php-fpm-56 status php-fpm-56.service - LSB: starts php-fpm Loaded: loaded (/etc/init.d/php-fpm-56; bad; vendor preset: enabled) Active: inactive (dead) Docs: man:systemd-sysv-generator(8) |
我们可以看到,php5.6并没有启动,所以我们只需要将其启动即可。
1 |
sudo service php-fpm-56 start |
这个时候我们再看一下状态:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
(base) mcj@mcj2080:/usr/include$ service php-fpm-56 status \u25cf php-fpm-56.service - LSB: starts php-fpm Loaded: loaded (/etc/init.d/php-fpm-56; bad; vendor preset: enabled) Active: active (running) since \u4e00 2019-07-01 11:34:20 CST; 1s ago Docs: man:systemd-sysv-generator(8) Process: 14186 ExecStart=/etc/init.d/php-fpm-56 start (code=exited, status=0/SUCCESS) Tasks: 21 Memory: 22.0M CPU: 49ms CGroup: /system.slice/php-fpm-56.service \u251c\u250014202 php-fpm: master process (/www/server/php/56/etc/php-fpm.conf) \u251c\u250014204 php-fpm: pool www \u251c\u250014205 php-fpm: pool www \u251c\u250014206 php-fpm: pool www \u251c\u250014207 php-fpm: pool www \u251c\u250014209 php-fpm: pool www \u251c\u250014210 php-fpm: pool www \u251c\u250014211 php-fpm: pool www \u251c\u250014212 php-fpm: pool www \u251c\u250014213 php-fpm: pool www \u251c\u250014214 php-fpm: pool www \u251c\u250014215 php-fpm: pool www \u251c\u250014216 php-fpm: pool www \u251c\u250014217 php-fpm: pool www \u251c\u250014218 php-fpm: pool www \u251c\u250014219 php-fpm: pool www \u251c\u250014220 php-fpm: pool www \u251c\u250014221 php-fpm: pool www \u251c\u250014222 php-fpm: pool www \u251c\u250014223 php-fpm: pool www \u2514\u250014224 php-fpm: pool www 7\u6708 01 11:34:20 mcj2080 systemd[1]: Starting LSB: starts php-fpm... 7\u6708 01 11:34:20 mcj2080 php-fpm-56[14186]: Starting php-fpm done 7\u6708 01 11:34:20 mcj2080 systemd[1]: Started LSB: starts php-fpm. |
OK,已经正常启动了,此时再打开网站,可以发现已经正常了!
本文最后更新于2023年6月6日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!