Home » Php » homebrew – PHP-FPM Stop/Reload Issues on Mac Lion (OSX 10.7)

homebrew – PHP-FPM Stop/Reload Issues on Mac Lion (OSX 10.7)

Posted by: admin July 12, 2020 Leave a comment

Questions:

I’m setting up php-fpm on my machine and I installed it using homebrew (specifically homebrew-alt). Everything installed fine and if I open up the terminal and type the command “php-fpm” it starts up fine. Unfortunately if I try to run any commands such as “php-fpm stop” I get the message below. Does anyone have any idea what may be causing this or how I could get it working? If I try killing the process with the kill command it just seems to automatically restart itself.

Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -h               This help
  -i               PHP information
  -m               Show compiled in modules
  -v               Version number
  -p, --prefix <dir>
                   Specify alternative prefix path to FastCGI process manager (default: /usr/local/Cellar/php/5.3.8).
  -g, --pid <file>
                   Specify the PID file location.
  -y, --fpm-config <file>
                   Specify alternative path to FastCGI process manager config file.
  -t, --test       Test FPM configuration and exit
How to&Answers:

Alternatively, using the USR2 signal makes php-fpm reload its configuration file:

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

Answer:

You can use Lanchctl:

Stop:

launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist

Start:

launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist

Adapt the version number “php55” to your environment.

Answer:

sudo killall php-fpm

Use this command, you can kill php-fpm.
I have tried, it works.

System: Mac OS X 10.11.4

Answer:

I’ve php-fpm installed on OSX Lion (through macports), and using the kill command to stop it. It seems to work fine.

Are you trying to kill php-fpm directly, or using the pid file? There will be lots of php-fpm instances, as it works with child-processes, you might not be killing the main app. The command I’m using is

sudo kill `cat /pid-path/php-fpm.pid`

I don’t know what the pid file location is set for php-fpm when installed through homebrew. But you can find out from the compiler script, or php-fpm’s conf file (if defined).

Also you can update the file database from terminal, and do a locate call.
Try running these commands with sudo

ln -s /usr/libexec/locate.updatedb /usr/bin/updatedb
updatedb

updatedb may take some time to finish. And then just do

locate php-fpm.pid

Answer:

You’re also can close php-fpm in Activity Monitor. Just choose the process and press Quit button.