I'm currently using MacOSX 10.8 and I tried to install the built-in php-fpm.
Moreover I want a plist file to start and stop php-fpm on demand. I found this one
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>net.php.php-fpm</string>
<key>LaunchOnlyOnce</key>
<true/>
<key>NetworkState</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/php-fpm</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>PHP FastCGI Process Manager</string>
<key>StandardErrorPath</key>
<string>/var/log/system.log</string>
</dict>
</plist>
Where the launchctl (with sudo) -w load works find... When I try to unload I get this error:
launchctl: Error unloading: net.php.php-fpm
I don't really understand why?
UPDATE:
$ sudo launchctl load -w /Library/LaunchAgents/net.php.php-fpm.plist
$ ps aux | grep php
nobody 2055 0.0 0.0 2450420 604 ?? S 2:28PM 0:00.00 /usr/sbin/php-fpm
nobody 2054 0.0 0.0 2450420 604 ?? S 2:28PM 0:00.00 /usr/sbin/php-fpm
root 2053 0.0 0.0 2450420 668 ?? Ss 2:28PM 0:00.00 /usr/sbin/php-fpm
$ tail -f /var/log/system.log
Jan 31 14:28:12 XXXXXX sudo[2040]: t5e : TTY=ttys001 ; PWD=/Volumes/diskE/Users/XXX ; USER=root ; COMMAND=/bin/launchctl load -w /Library/LaunchAgents/net.php.php-fpm.plist
$ sudo launchctl unload -w /Library/LaunchAgents/net.php.php-fpm.plist
launchctl: Error unloading: net.php.php-fpm
$ ps aux | grep php
nobody 2054 0.0 0.0 2450420 604 ?? S 2:28PM 0:00.00 /usr/sbin/php-fpm
root 2053 0.0 0.0 2450420 668 ?? Ss 2:28PM 0:00.00 /usr/sbin/php-fpm
nobody 2055 0.0 0.0 2450420 604 ?? S 2:28PM 0:00.00 /usr/sbin/php-fpm
$ tail -f /var/log/system.log
Jan 31 14:28:30 XXXXXX sudo[2081]: t5e : TTY=ttys001 ; PWD=/Volumes/diskE/Users/XXX ; USER=root ; COMMAND=/bin/launchctl unload -w /Library/LaunchAgents/net.php.php-fpm.plist
launchctlin the Terminal. To clarify, I meant the program called "Console" in/Applications/Utilities, providing easy access to the system logs. Did you check that? – Daniel Beck♦ Jan 31 at 13:23