Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

homebrew

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
like image 970
Splashlin Avatar asked Nov 18 '11 02:11

Splashlin


3 Answers

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.

like image 59
Maarten Wolzak Avatar answered Nov 12 '22 00:11

Maarten Wolzak


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

kill -USR2 `cat /usr/local/var/run/php-fpm.pid`
like image 31
Laurent Chardin Avatar answered Nov 12 '22 01:11

Laurent Chardin


sudo killall php-fpm

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

System: Mac OS X 10.11.4

like image 30
Germey Avatar answered Nov 12 '22 00:11

Germey