How To Daemonize PHP-FPM on Mac OS-X Mountain Lion with Brew
One of the easiest ways to install/upgrade PHP on Mac OS-X is using brew. In the current version, if you install PHP 5.3 or 5.4 via brew using FPM, the php-fpm launcher installs in the foreground mode, by default. That can be very inconvenient, since it means that when you launch php-fpm it holds a terminal window and if you close the window, the process dies.
Luckily it is also something very easy to fix.
First, locate php-fpm configuration file by running a configuration test:
You should see an output like:
Now open the php-fpm.conf file in your favorite editor and find a configuration option that looks like:
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. ; Default Value: yes daemonize = no
and change the value to "yes", or comment the configuration out (since default is "yes").