Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

systemctl says the PHP FastCGI Process Manager failed to start

ErrorFailed to start The PHP FastCGI Process Manager.

Short answer

The systemd message only says that php-fpm exited. The reason is in the journal or in php-fpm's own config test. Run the test with -t. It reports what it cannot parse. The common causes are a broken directive, a pool missing a mandatory setting such as listen or user, or a pool set to run as root.

  • Applies to PHP 8.3 FPM, Ubuntu 24.04, systemd
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask systemd for the last lines of the unit, then ask php-fpm itself to test its configuration. Replace 8.3 with the version you installed.

    sudo journalctl -u php8.3-fpm -n 30 --no-pager
    sudo php-fpm8.3 -t
  2. 2Match what you see, then jump to its fix

    1. 1The -t test prints an error instead of exiting quietlyA directive or file in the configuration is invalidFix
    2. 2The pool section has no listen, user, pm or pm.max_children lineA pool is missing a mandatory settingFix
    3. 3The pool section has user = root, or the service was changed to run workers as rootA pool is set to run as rootFix

What does the error look like?

  • Failed to start The PHP FastCGI Process Manager.

Cause 1 of 3

A directive or file in the configuration is invalid

1Check

php-fpm has a test mode: -t tests the configuration file and exits, and -tt also dumps the configuration it read. A typo, a stray character or a bad include in php-fpm.conf or a pool file stops the service.

sudo php-fpm8.3 -tt

2Fix

Open the file the test points at, correct the directive, then run the test again until it reports no errors.

sudo nano /etc/php/8.3/fpm/pool.d/www.conf
sudo php-fpm8.3 -t

3Verify

Start the service and check its state.

sudo systemctl restart php8.3-fpm && systemctl is-active php8.3-fpm

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 3

A pool is missing a mandatory setting

1Check

The PHP manual marks listen and user as mandatory for each pool. It does the same for pm and pm.max_children. A pool file copied from an example, or edited by script, can lose one of them.

grep -nE '^(\[|listen|user|group|pm)' /etc/php/8.3/fpm/pool.d/*.conf

2Fix

Add the missing directives to the pool. The listen value can be an ip:port pair, a port or a path to a Unix socket.

[www]
user = www-data
group = www-data
listen = /run/php/php8.3-fpm.sock
; keep your existing pm and pm.max_children lines

3Verify

Run the configuration test and then start the service.

sudo php-fpm8.3 -t && sudo systemctl restart php8.3-fpm

Confirmed by php.net

Did this fix it?

Cause 3 of 3

A pool is set to run as root

1Check

The php-fpm man page lists -R as the switch that allows a pool to run as root, and says this is disabled by default. Without it, a root pool is refused.

grep -n "^user" /etc/php/8.3/fpm/pool.d/*.conf

2Fix

Run the pool as an unprivileged user such as the web server's user, and make the application's folders readable and writable by that user.

user = www-data
group = www-data

3Verify

Restart and check that workers are not root.

sudo systemctl restart php8.3-fpm && ps -o user,cmd -C php-fpm8.3

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Run php-fpm -t before every restart or reload after editing a pool or php.ini.
  • Keep one pool file per application so a broken pool is easy to find.
  • Do not hand-edit configuration without a version-controlled copy to roll back to.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

nginx gives up waiting for the app and returns 504

upstream timed out (110: Connection timed out) while reading response header from upstream

nginx returns 504 when the app behind it takes the request but sends nothing back within proxy_read_timeout (60 seconds by default), or when the connection cannot be opened in time.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.