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.

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