Skip to content
Advertisement

nginx error connect to php5-fpm.sock failed (13: Permission denied)

I update nginx to 1.4.7 and php to 5.5.12, After that I got the 502 error. Before I update everything works fine.

nginx-error.log

JavaScript

nginx.conf

JavaScript

Advertisement

Answer

I had a similar error after php update. PHP fixed a security bug where o had rw permission to the socket file.

  1. Open /etc/php5/fpm/pool.d/www.conf or /etc/php/7.0/fpm/pool.d/www.conf, depending on your version.
  2. Uncomment all permission lines, like:

    JavaScript
  3. Restart fpm – sudo service php5-fpm restart or sudo service php7.0-fpm restart

Note: if your webserver runs as user other than www-data, you will need to update the www.conf file accordingly

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement