10

I'm running nginx, and fastcgi to run a wordpress blog.

After a while of running, I am getting 502 bad gateway errors. If i reboot the server things work fine.

Other sites that are running on nginx are not effected (they are not php based), so I just figured out it must be the fastcgi process after looking at the log files saying the upstream client 127.0.0.1 is not responding.

How to I restart this? Is there a special log file for this fastcgi process?

Blankman
  • 2,891
  • 10
  • 39
  • 68

3 Answers3

10

It depends of the Distro/Type but it is probably:

service php-fpm restart
or
service php5-fpm restart

Anyway restarting service is not a solution, you should find the problem why do the upstream is not responding. You may provide some logs to clarify the issue.

Andrei Mikhaltsov
  • 3,027
  • 1
  • 23
  • 31
  • I use Docker's "php:7.4-fpm" image; I am getting "unrecognized service." error. I tried: php-fpm, php5-fpm, php7-fpm, php7.0-fpm, php7.4-fpm (none work) – Top-Master Oct 09 '22 at 11:00
6

Depends on the install:

  • find init.d script: ls -al /etc/init.d/*php*
  • look /usr/bin/php-fastcgi: ls -al /usr/bin/php-fastcgi
  • look /usr/bin/spawn-fcgi(if exist '/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -f /usr/bin/php5-cgi' to start, 'killall spawn-fcgi' to stop)
alvosu
  • 8,437
  • 25
  • 22
1

In Ubuntu every site have a process in

/etc/init.d/php-fcgi-domain-com-br

So, to restart a PHP domain proccess type:

sudo service php-fcgi-domain-com-br restart
Luiz Lopes
  • 11
  • 2