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
listen.group = 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

fastcgi_pass 127.0.0.1:9000;

and then change php5-fpm config to match it.

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s