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

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

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Diagnosing and Stopping PHP-FPM on macOS

When managing a local development stack on macOS, particularly using Homebrew, it is easy to assume that standard Linux utilities translate directly to the operating system. A common friction point arises when attempting to control the PHP FastCGI Process Manager (php-fpm). You might successfully install the package, configure Nginx to forward requests to 127.0.0.1:9000, and verify that your web server is serving static content or even processing dynamic scripts. However, when you attempt to restart the service using service php-fpm restart or inspect its status, you are met with a command not found error.

This disconnect happens because macOS does not utilize the init.d system that many developers expect from Unix-like environments. The service command is specific to SysV init systems, which are absent on modern macOS installations. Consequently, running php-fpm directly from the terminal without arguments attempts to execute the binary as a standalone process rather than starting the daemonized service. This behavior explains the error logs you see when invoking the command:

[24-Jul-2013 19:58:34] ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2)
ERROR: failed to load configuration file '/private/etc/php-fpm.conf'
ERROR: FPM initialization failed

The error indicates that the binary is trying to locate a configuration file at /private/etc/php-fpm.conf, which does not exist. In a Homebrew installation, php-fpm typically installs its configuration in a directory structure different from the standard Linux paths. By default, Homebrew places files in /usr/local/etc. The binary expects to find the main php-fpm.conf and the pool definitions within that location. If you ran the installation without specifying custom paths, the executable is looking in the wrong place because it is not invoking the wrapper script provided by Homebrew.

To correctly start or stop the service, you must interact with the specific process manager responsible for managing daemons on macOS. In this environment, launchd serves as that manager. You can identify the actual bundle name and configuration path using the brew info php-fpm command or by inspecting the installed files in /usr/local/etc/php-fpm/.

Once you locate the configuration file (often named something like www.conf or php-fpm.conf within the Homebrew directory) and confirm the binary is actually running PHP 5.4 as intended, you need to manage the daemon via launchctl. The command to load the configuration and start the service would generally look like this:

sudo launchctl load -w /usr/local/etc/php-fpm/9000.plist

The -w flag tells launchctl to write the job description to the system plist, ensuring the process persists across reboots. To stop the service, you use the unload command:

sudo launchctl unload -w /usr/local/etc/php-fpm/9000.plist

If your setup does not include a pre-generated .plist file, you may need to create one manually using launchctl bootstrap. The key takeaway is that php-fpm on macOS is not a system service controlled by service, nor is it always an interactive CLI tool. It is a background process managed by launchd.

There is also the matter of version discrepancies. If you installed PHP 5.4 via Homebrew but see output indicating PHP 5.3.15, you are likely running the wrong binary or have multiple versions installed. Ensure that your shebang line in any custom scripts points to the correct path, typically /usr/local/bin/php-fpm, and that your Nginx configuration is pointing to the socket or port created by the specific version you intend to use.

For developers working on larger projects where PHP configuration management becomes critical, managing these local services can become cumbersome. While Homebrew is excellent for installing dependencies, production-grade PHP environments often benefit from dedicated package managers like PHP's PECL or containerized solutions. If you find yourself needing to switch between multiple PHP versions frequently or manage complex configurations, consider using a tool like phive or switching to a container-based workflow where version isolation is handled natively.

If your project eventually moves to a framework like Laravel, the need for manual service management diminishes significantly. Platforms like Laravel Forge handle the provisioning of servers with pre-configured PHP versions and services, eliminating the need to manually debug launchd configurations on macOS. For more information on deploying Laravel applications efficiently, you might explore resources available at https://laravelcompany.com, which often discusses modern deployment strategies that abstract away these low-level OS specifics.

Our network