How to fix WordPress auto update on Nginx & PHP-FPM

What i like about WordPress is the ability to install and update directly from the dashboard without using other software like FTP. But sometimes the function would not work.

The problem? File ownership or permission. Here some tips on how to fix it.

1. Confirm the file belong to Nginx.

On Apache, all the file should be own by www-data user. On some distribution that come with Nginx, “nginx” is the user. So to make sure all our web data belong to Nginx, we need to do this command.

sudo chown -R nginx:nginx /var/www/*

The location varies on platform. For mine it’s on /var/www

2. Confirm PHP-FPM run as nginx

On Fedora distribution, PHP-FPM run as apache. While it will work well on apache base server. It will not work on Nginx. To solve this we need to do this command.

sudo nano /etc/php-fpm.d/www.conf

The location varies on platform. For mine it’s on /etc/php-fpm.d. After that change “user” & “group” to “nginx”

user = nginx
group = nginx

Save and do restart on PHP-FPM

This should fix the auto update problem. If it’s not work do tell in the comment.

Leave a comment