Unable to start php8.2-fpm on Ubuntu 20.04

I’m currently having an error 502 Bad Gateway on my development environment. I suspect that this is due to php8.2-fpm not starting. I’m not sure what’s causing it, but here’s what I can see from its status.

sudo systemctl status php8.2-fpm.service
 php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php8.2-fpm.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2025-01-02 21:55:04 CST; 8min ago
       Docs: man:php-fpm8.2(8)
    Process: 2120 ExecStart=/usr/sbin/php-fpm8.2 --nodaemonize --fpm-config /etc/php/8.2/fpm/php-fpm.conf (code=exited, status=78)
    Process: 2122 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.2/fpm/pool.d/www.conf 82 (code=exited, status=0/SUCCESS)
    Process: 2123 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/8.2/fpm/pool.d/www.conf 82 (code=exited, status=0/SUCCESS)
   Main PID: 2120 (code=exited, status=78)

Jan 02 21:55:04 site-name systemd[1]: php8.2-fpm.service: Failed with result 'exit-code'.
Jan 02 21:55:04 site-name systemd[1]: php8.2-fpm.service: Scheduled restart job, restart counter is at 5.
Jan 02 21:55:04 site-name systemd[1]: Stopped The PHP 8.2 FastCGI Process Manager.
Jan 02 21:55:04 site-name systemd[1]: php8.2-fpm.service: Start request repeated too quickly.
Jan 02 21:55:04 site-name systemd[1]: php8.2-fpm.service: Failed with result 'exit-code'.
Jan 02 21:55:04 site-name systemd[1]: Failed to start The PHP 8.2 FastCGI Process Manager.

I’ve looked into similar issues online but had no luck in trying to solve it.

I had to apply this workaround as well for php8.2-fpm to get it to provision on my development environment.

Any ideas?

Without the workaround, do you get more details using journalctl -xeu php8.2-fpm.service"?
Ubuntu 20.04 is EOL, but you may have reasons why you are stuck with that version for now.

@strarsis Yeah here’s what I got from journalctl -xeu php8.2-fpm.service

-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit php8.2-fpm.service has finished successfully.
-- 
-- The job identifier is 3747.
Jan 02 22:07:15 site-name php-fpm8.2[2491]: [02-Jan-2025 22:07:15] WARNING: Nothing matches the include pattern '/etc/php/8.2/fpm>
Jan 02 22:07:15 site-name php-fpm8.2[2491]: [02-Jan-2025 22:07:15] ERROR: No pool defined. at least one pool section must be spec>
Jan 02 22:07:15 site-name php-fpm8.2[2491]: [02-Jan-2025 22:07:15] ERROR: failed to post process the configuration
Jan 02 22:07:15 site-name php-fpm8.2[2491]: [02-Jan-2025 22:07:15] ERROR: FPM initialization failed
Jan 02 22:07:15 site-name systemd[1]: php8.2-fpm.service: Main process exited, code=exited, status=78/CONFIG
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit php8.2-fpm.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 78.
Jan 02 22:07:15 site-name systemd[1]: php8.2-fpm.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit php8.2-fpm.service has entered the 'failed' state with result 'exit-code'.
Jan 02 22:07:15 site-name systemd[1]: php8.2-fpm.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit php8.2-fpm.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jan 02 22:07:15 site-name systemd[1]: Stopped The PHP 8.2 FastCGI Process Manager.
-- Subject: A stop job for unit php8.2-fpm.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit php8.2-fpm.service has finished.
-- 
-- The job identifier is 3846 and the job result is done.
Jan 02 22:07:15 site-name systemd[1]: php8.2-fpm.service: Start request repeated too quickly.
Jan 02 22:07:15 site-name systemd[1]: php8.2-fpm.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit php8.2-fpm.service has entered the 'failed' state with result 'exit-code'.
Jan 02 22:07:15 site-name systemd[1]: Failed to start The PHP 8.2 FastCGI Process Manager.
-- Subject: A start job for unit php8.2-fpm.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

Update: I’ve updated Ubuntu to v24.04 and I was able to provision the development environment without doing the workaround, but php8.2-fpm still isn’t starting with the same issues as above.