Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Aug 30, 2025, 05:00 AM

Title: Wordpress website admin page shows 502 Bad Gateway: php-fpm.sock failed
Post by: Suhitha on Aug 30, 2025, 05:00 AM
Queation: Wordpress website admin page shows 502 Bad Gateway: php-fpm.sock failed (2: No such file or directory)


Applicable to:


Symptoms



/opt/plesk/php/X.X/etc/php-fpm.d does not contain a config file for example.com, because the domain is not set to run PHP as an FPM application served by Apache

The following error is shown in /var/www/vhosts/system/example.com/logs/proxy_error_log log file:

# 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

1.Log into Plesk

2.Go to Domains > example.com > PHP Settings

3.Set the used PHP handler to run PHP as FPM application served by Apache via the dropdown

4.Scroll down and press Apply