[Solved] v1.9.1 - Error 500 - Connection refused AH02454 - php8.1-fpm - sock files

Hi all,

Today, Hestia Control Panel upgraded v1.8.12 to v1.9.1, and Internal Server Error 500 has appeared on our WordPress website.

In the logs of the website, we get “Connection refused AH02454 FCGI attempt to connect to Unix domain socket /run/php/php8.1-fpm.xxx.sock

Hestia’s update log showed that there was an error occuring while restarting service php8-1-fpm during the update.

Also, when we try to start (or restart) the service manually with the following command

> service php8.1-fpm start

Then it says : ERROR Another FPM instance seems to already listen on /run/php/www.sock

Nothing works on the /run/php/www.sock file if we try : to copy (cp) it for backup, to open the file (VI) or to change the attributes (chattr). It’s like it’s protected, even from root.

Feel free to see the screenshots below for more details.

ScreenShots_of_issues_after_Update_Hestia_1.9.1

Can someone help please ? We’re really out of idea.

Thanks in advance.

Check for multiple www.conf files in /etc/php/x.x/pool.d (or similar, not sure about the path - x.x stands for php version). If you find more than one, remove one of the version you dont need, restart the related services.

Thank you for your response.

In the folder, there were 3 files

/etc/php/8.1/fpm/pool.d/dummy.conf
/etc/php/8.1/fpm/pool.d/ourwebsitename.conf
/etc/php/8.1/fpm/pool.d/www.conf

I removed them all (I made backups of them into a new subfolder).

And now, the service has started successfully.

However, the main error 500 is still there, and in the log we still get :
Connection refused: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.1-fpm-ourwebsitename.sock (localhost:8000) failed

Any idea please ?

ls /etc/php/*/fpm/pool.d/www.conf

Response :

/etc/php/8.0/fpm/pool.d/www.conf

More details :
Screenshots_Conf_Files

I finally fixed the issue.

From the beginning, the real problem was at the socket permission.

I put down bellow my walkthrough, for everyone who need to understand it in the future.

1°) Check permissions on socket file (Apache has no right as user for the moment)

root@server:/run/php# ls -l


srw-rw---- 1 dev www-data 0 Feb 4 15:38 php8.1-fpm-websitename.sock

2°) Have to give permission to Apache’s user (aka www-data)

root@server:/run/php# chown www-data:www-data php8.1-fpm-websitename.sock
root@server:/run/php# ls -l


srw-rw---- 1 www-data www-data 0 Feb 4 15:38 php8.1-fpm-websitename.sock

3°) Check PHP 8.1 FPM status (failed)

root@server:/run/php# service php8.1-fpm status


Active: failed (Result: exit-code)

… WARNING: Nothing matches the include pattern '/etc/php/8.1/fpm/pool.d/*.>
… ERROR: No pool defined. at least one pool section must be specified in c>

4°) Trying to restart Apache (failed)

root@server:/run/php# systemctl restart apache2


Active: failed (Result: exit-code)

… WARNING: Nothing matches the include pattern '/etc/php/8.1/fpm/pool.d/*.>
… ERROR: No pool defined. at least one pool section must be specified in c>

5°) Navigating to PHP 8.1 Pool.D (backup of conf files I made), and restauring the conf file (said in the error log “Connection refused : AH02454”)

root@server:/# cd /etc/php/8.1/fpm/pool.d/BACKUP_conf/
root@server:/etc/php/8.1/fpm/pool.d/BACKUP_conf# cp BKP__websitename--cnf /etc/php/8.1/fpm/pool.d/websitename.conf

6°) Checking if conf file is in right place

root@server:/etc/php/8.1/fpm/pool.d/BACKUP_conf# cd ..
root@server:/etc/php/8.1/fpm/pool.d# ls -l


-rw-r–r-- 1 root root 1243 Feb 5 17:42 websitename.conf

7°) Restarting Apache and PHP 8.1 FPM

root@server:/etc/php/8.1/fpm/pool.d# systemctl restart apache2
root@server:/etc/php/8.1/fpm/pool.d# systemctl restart php8.1-fpm

root@server:/etc/php/8.1/fpm/pool.d# service php8.1-fpm status


Active: active (running)

Status: “Ready to handle connections”

8°) Checking if the site is back in the web browser

Website is back again !

Thank you all. You contributed to lead me to the solution.

1 Like

@eris Is it helpful for you to fix the error?