Today I encountered an issue: after updating Ubuntu on my VM, the php8.2-fpm service failed to start:
sudo service php8.2-fpm status
× 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 Sat 2025-02-15 20:49:40 CET; 1min 20s ago
Docs: man:php-fpm8.2(8)
Process: 1247 ExecStart=/usr/sbin/php-fpm8.2 --nodaemonize --fpm-config /etc/php/8.2/fpm/php-fpm.conf (code=exited, status=78)
Process: 1277 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: 1247 (code=exited, status=78)
CPU: 71ms
Feb 15 20:49:40 mydomain.com systemd[1]: php8.2-fpm.service: Failed with result 'exit-code'.
Feb 15 20:49:40 mydomain.com systemd[1]: Failed to start The PHP 8.2 FastCGI Process Manager.
Feb 15 20:49:40 mydomain.com systemd[1]: php8.2-fpm.service: Scheduled restart job, restart counter is at 5.
Feb 15 20:49:40 mydomain.com systemd[1]: Stopped The PHP 8.2 FastCGI Process Manager.
Feb 15 20:49:40 mydomain.com systemd[1]: php8.2-fpm.service: Start request repeated too quickly.
Feb 15 20:49:40 mydomain.com systemd[1]: php8.2-fpm.service: Failed with result 'exit-code'.
Feb 15 20:49:40 mydomain.com systemd[1]: Failed to start The PHP 8.2 FastCGI Process Manager.
With the help of Claude-AI, I managed to resolve the issue after nearly an hour of troubleshooting (I’m still learning Linux system administration). I’d like to share the simple solution I found, even though I don’t fully understand the root cause. Hopefully, this information will help others facing similar issues.
Note: I suspect the problem occurred because I left the terminal unattended during the Ubuntu server update process. When upgrading packages, you’re typically prompted to either replace or keep existing configuration files. I believe the upgrade process automatically replaced my existing php8.2-fpm configuration file with the default one while I was away.
Some outputs
During my troubleshooting process, I executed the following commands and received these outputs.
Note: Prior to the Ubuntu upgrade, I was using php8.2-fpm for my single hosted domain (mydomain.com). Due to these issues, I decided to migrate to php8.3-fpm (fortunately, the software is compatible with it) and then focused on resolving the php8.2-fpm service start issue.
sudo ls -la /etc/php/*.*/fpm/pool.d/
/etc/php/7.4/fpm/pool.d/:
total 12
drwxr-xr-x 2 root root 4096 Feb 15 19:06 .
drwxr-xr-x 4 root root 4096 Feb 15 19:06 ..
-rw-r--r-- 1 root root 346 Feb 6 05:53 dummy.conf
/etc/php/8.0/fpm/pool.d/:
total 12
drwxr-xr-x 2 root root 4096 Feb 15 19:06 .
drwxr-xr-x 4 root root 4096 Feb 15 19:06 ..
-rw-r--r-- 1 root root 346 Feb 6 05:53 dummy.conf
/etc/php/8.2/fpm/pool.d/:
total 16
drwxr-xr-x 2 root root 4096 Feb 15 19:39 .
drwxr-xr-x 4 root root 4096 Feb 15 19:06 ..
-rw-r--r-- 1 root root 346 Feb 6 05:53 dummy.conf
-rw-r--r-- 1 root root 335 Feb 6 05:53 www.conf
/etc/php/8.3/fpm/pool.d/:
total 20
drwxr-xr-x 2 root root 4096 Feb 15 19:39 .
drwxr-xr-x 4 root root 4096 Feb 15 19:06 ..
-rw-r--r-- 1 root root 611 Feb 6 05:53 dummy.conf
-rw-r--r-- 1 root root 1300 Feb 15 19:39 mydomain.com.conf
-rw-r--r-- 1 root root 335 Feb 6 05:53 www.conf
sudo grep -r 'php*.*-fpm.*\.sock$' /etc/php/
/etc/php/7.4/fpm/pool.d/dummy.conf:listen = /run/php/php7.4-fpm.dummy.sock
/etc/php/8.3/fpm/pool.d/dummy.conf:listen = /run/php/php%backend_version%-fpm-%domain%.sock
/etc/php/8.3/fpm/pool.d/mydomain.com.conf:listen = /run/php/php8.3-fpm-mydomain.com.sock
/etc/php/8.2/fpm/pool.d/dummy.conf:listen = /run/php/php8.2-fpm.dummy.sock
/etc/php/8.0/fpm/pool.d/dummy.conf:listen = /run/php/php8.0-fpm.dummy.sock
The following command and output indicated the root cause of the php8.2-fpm service start failure: “another FPM instance seems to already listen on”
sudo tail -f /var/log/php8.2-fpm.log
[15-Feb-2025 20:49:37] ERROR: Another FPM instance seems to already listen on /run/php/www.sock
[15-Feb-2025 20:49:37] ERROR: FPM initialization failed
[15-Feb-2025 20:49:38] ERROR: Another FPM instance seems to already listen on /run/php/www.sock
[15-Feb-2025 20:49:38] ERROR: FPM initialization failed
Solution
As i said above, following recommendations from Claude i runned this:
sudo rm -f /run/php/www.sock
sudo systemctl stop php8.2-fpm
sudo rm -f /run/php/php-fpm.sock
sudo rm -f /run/php/php8.2-fpm.sock
sudo systemctl start php8.2-fpm
And voilà…
sudo systemctl status php8.2-fpm
● 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: active (running) since Sat 2025-02-15 21:19:06 CET; 8s ago
Docs: man:php-fpm8.2(8)
Process: 6304 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/ph>
Main PID: 6303 (php-fpm8.2)
Status: "Ready to handle connections"
Tasks: 1 (limit: 1077)
Memory: 12.1M
CPU: 93ms
CGroup: /system.slice/php8.2-fpm.service
└─6303 "php-fpm: master process (/etc/php/8.2/fpm/php-fpm.conf)" "" "" "" "" "" "" "" "" "">
Feb 15 21:19:06 mydomain.com systemd[1]: Starting The PHP 8.2 FastCGI Process Manager...
Feb 15 21:19:06 mydomain.com systemd[1]: Started The PHP 8.2 FastCGI Process Manager.
lines 1-15/15 (END)
And also:
sudo ps aux | grep php-fpm
root 631 0.0 4.1 660880 41364 ? Ss 20:49 0:00 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
root 632 0.0 4.1 659800 41640 ? Ss 20:49 0:00 php-fpm: master process (/etc/php/8.0/fpm/php-fpm.conf)
root 634 0.0 3.8 655056 38636 ? Ss 20:49 0:00 php-fpm: master process (/etc/php/8.3/fpm/php-fpm.conf)
root 827 0.0 0.6 82408 6696 ? Ss 20:49 0:00 php-fpm: master process (/usr/local/hestia/php/etc/php-fpm.conf)
root 6303 0.2 4.3 697592 43048 ? Ss 21:19 0:00 php-fpm: master process (/etc/php/8.2/fpm/php-fpm.conf)
root 6321 0.0 0.2 7016 2180 pts/0 S+ 21:19 0:00 grep --color=auto php-fpm
I hope this information helps other users resolve similar issues. However, if you understand the issue I’ve described, could you please add any comments to help us better understand why this problem arose? Additionally, could you provide advice on how to prevent it from happening again?
Thank you in advance!
Sergi