Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
    
Anything useful visible in Console? – Daniel Beck Jan 31 '13 at 12:18
    
No just the line above – Kakawait Jan 31 '13 at 12:53
    
What you wrote seems to be an error printed by launchctl in 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 '13 at 13:23
    
See update in question core – Kakawait Jan 31 '13 at 13:33
up vote 0 down vote accepted

I found my response inside Homebrew bug tracking system:

https://github.com/josegonzalez/homebrew-php/issues/370

It's about PHP-FPM configuration, we must put PHP-FPM daemonize to no (default = true)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .