Cobra Forum

Plesk Panel => Webserver => Topic started by: mahesh on Dec 09, 2024, 05:06 AM

Title: Wordpress website admin page shows 502 Bad Gateway: php-fpm.sock failed
Post by: mahesh on Dec 09, 2024, 05:06 AM
Question:

Wordpress website admin page shows 502 Bad Gateway: php-fpm.sock failed (2: No such file or directory)
Symptoms
#tail -f /var/www/vhosts/system/example.com/logs/proxy_error_log
...
[crit] 3003#0: *635755 connect() to unix:///var/www/vhosts/system/example.com/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 213.21.0.10, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:///var/www/vhosts/system/example.com/php-fpm.sock:", host: "example.com"

Cause
A plugin or theme in the WordPress script requires an existing php-fpm.sock file, however when PHP runs as a FastCGI application served by Apache, such a file is not generated and it is therefore expected for it to be missing. This means that this specific website is only able to work properly when PHP runs as an FPM application served by Apache.

Resolution