How to fix 502 Gateway issue caused by nginx fastcgi fpm and WordPress running on Ubuntu 14.04

By some reason using sockets causing the on Ubuntu 14.04 with fastcig and php5-fpm is causing errors

502 Gateway issues and so on

There are two ways you may want to try:

Change your settings in your nginx server to use:

Open /etc/php5/fpm/pool.d/www.conf and uncomment the following lines:

listen.owner = www-data = www-data
listen.mode = 0660 (some people changing it to 0666) altought it might not be a best solution

make sure that the owner of the file is www-data as well.

Other option is to don’t use sockets

so replace in you sites-available and then your website

fastcgi_pass unix:var/run/php5-fpm.sock to


and then change php5-fpm config to match it.

/etc/php5/fpm/pool.d/www.conf:listen =


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s