PHP FastCGI Process Manager

PHP FPM (FastCGI Process Manager) is a primary PHP FastCGI implementation containing some features (mostly) useful for heavy-loaded sites.

Unix socket

PHP FPM supports the usage of Unix socket to listen to connections. By default, the socket phpfpm.sock will be used.

# Inside `process-compose.<name>`
{
  services.phpfpm."php1" = {
    enable = true;
    extraConfig = {
      "pm" = "ondemand";
      "pm.max_children" = 1;
    };
  };
}

TCP port

# Inside `process-compose.<name>`
{
  services.phpfpm."php1" = {
    enable = true;
    listen = 9000;
    extraConfig = {
      "pm" = "ondemand";
      "pm.max_children" = 1;
    };
  };
}

Usage example

https://github.com/juspay/services-flake/blob/main/nix/services/phpfpm_test.nix