2
  501 25131     1   0  9:31下午 ??         0:00.37 /usr/local/opt/php/sbin/php-fpm --nodaemonize
  501 25136 25131   0  9:31下午 ??         0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
  501 25137 25131   0  9:31下午 ??         0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
  501 26377 26220   0 10:32下午 ttys000    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn php-fpm

I modified php-fpm.conf daemonize = no, when restart php-fpm by

kill -USR2 'cat /usr/local/var/run/php-fpm.pid' 

and then I find I can't close php-fpm by

kill -9 25131

I can see fpm restart automatically through the error log:

[26-Sep-2018 23:13:43] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[26-Sep-2018 23:13:43] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[26-Sep-2018 23:13:43] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[26-Sep-2018 23:13:43] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[26-Sep-2018 23:13:43] NOTICE: fpm is running, pid 26948
[26-Sep-2018 23:13:43] NOTICE: ready to handle connections

It will restart with a new PID, I find no master process and dont know what does --nodaemonize mean.

This problem happened on my macbook just now.

Donne
  • 191
  • 1
  • 2
  • 8
  • Not really a programming question (ask server fault). Anyway on recent systems to stop php-fpm we do `systemctl stop php-fpm` (systemd) or `service php-fpm stop` (init). And [this](https://linux.die.net/man/8/php-fpm). – Déjà vu Sep 26 '18 at 14:54
  • @RingØ I forgot to say the problem happened on my macbook. – Donne Sep 26 '18 at 15:00

1 Answers1

10

In the dir ~/Library/LaunchAgents find this file homebrew.mxcl.php.plist.

Delete it and restart my mac, the problem was resolved.

Donne
  • 191
  • 1
  • 2
  • 8