Stopping "php-fpm" ( homebrew installation ) Mac OSX 10.8.2

Apple says: "The SystemStarter utility is deprecated."

But I found another great solution:

  1. Put this in ~/Library/LaunchDaemons/: https://github.com/tarnfeld/osx-stack/blob/master/LaunchDaemons/org.php-fpm.plist

  2. Change paths in this plist file according to your paths (e.g. my php-fpm executable is in /usr/sbin instead of /usr/local/sbin)

  3. Put the following in a new file in /usr/sbin/ or /usr/local/sbin/

.

/#!/bin/sh
echo "Stopping php-fpm..."
launchctl unload -w /Users/<home-folder>/Library/LaunchDaemons/org.php-fpm.plist
echo "Starting php-fpm..."
launchctl load -w /Users/<home-folder>/Library/LaunchDaemons/org.php-fpm.plist
echo "php-fpm restarted"
exit 0

make sure that directory is in your $PATH

Now you can call 'php-restart' to restart php-fpm

(Thanks to another post)


I used this guide for my set up: https://web.archive.org/web/20161220083008/https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew

And this command to restart my php-fpm:

brew services restart php56

If you don't have brew services, try installing it like this:

brew tap homebrew/services

In more modern versions, simply doing

brew services start php
brew services stop php
brew services restart php

would either start, stop or restart the php-fpm service.


If you use mac, You can checkout your php-fpm is running?

you can use this command: php-fpm -t

Now, You can see the question! And how to resolve by this error info in the command line!

Tags:

Php

Homebrew