PHP-FPM error on server reboot

| OS type and version | CentOS Linux 7.9.2009 |
| Webmin version | 1.994 |
| Virtualmin version | 7.1 |
| Related packages | Apache 2.4.6, PHP 8.1.9, PHP-FPM 8.1.9 Server |


When I set my sites to PHP-FPM all is just fine until after a server reboot. All processes are up & running (apache, PHP-FPM Server) but the websites throw an error 503 Service unavailable.

In the apache error log it shows
[proxy:error] [pid 1401] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/php-fpm/160415238918520.sock (*) failed
[proxy_fcgi:error] [pid 1401] [client ip:63564] AH01079: failed to make connection to backend: httpd-UDS, referer:

If I restart the PHP-FPM Server or if I leave it as is and change one of the sites back to FastCGI (or any of the other options) and immediately back to PHP-FPM it’s ok again (I guess that also triggers a restart of the PHP-FPM server process?)

It seems that after a reboot the directory /var/php-fpm is empty. After restarting PHP-FPM Server process it’s filled with the missing .sock files

This seems identical to the issue reported here: New sites php-fpm not working! but also after changing the PHP-FPM Server connection from socket files to TCP Port the behavior remains exactly the same. In the error log it shows

[proxy:error] [pid 1418] (111)Connection refused: AH00957: FCGI: attempt to connect to (*) failed
[proxy_fcgi:error] [pid 1418] [client my ip:64477] AH01079: failed to make connection to backend: localhost, referer:

again the /var/php-fpm directory is empty (not sure if this is relevant with the TCP Port option) and after restarting the PHP-FPM server it’s all good again.

I have a test-server and a production server (same OS & Virtual/webmin versions) who both experience this same issue.

Please advise on how best to resolve this (as I workaround I guess I could add a bootup-script to restart the PHP-FPM server but I’d rather have a structural solution)

What do you know, I figured it out myself…
Despite it being shown in the ‘server statusses’ overview on the webmin dashboard as running it wasn’t set to start on bootup… Fixed via the command systemctl enable php-php-fpm Runs like a charm now!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.