Droplet with ubuntu server + apache + Wordpress 4.8 fails to upgrade to 4.9

November 22, 2017 131 views
WordPress Ubuntu 16.04

We're experimenting problems trying to upgrade wp 4.8 to 4.9

It's fails indicating there's an issue with access permissions.

We have checked all around and we haven't detected the problem, so far.

Anyone else experimenting this issue?

We cannot upgrade but we can see that the new version has been downloaded into a new folder into upgrade folder indicating Wordpress-4.9

Help, please.


1 Answer
JasonLABS November 22, 2017
Accepted Answer

In my experience, there are several things it could be. Either file/folder permissions are incorrect, or the file/folder ownership is incorrect.

Before I offer any advice, I must cover and emphasize the following:
Step #1: ALWAYS make a backup of your site files, database, and any other important data.
Step #2: NEVER skip step #1
Step #3: Verify you have a working backup and that you have it in several locations just in case one of the backups is compromised at some point in time.

Now that you have made backups...

The most common fix for me when I encounter this issue is file/folder ownership.

Apache has the user www-data for permissions to do things on the server. You may need to give this user ownership of your WordPress files.

To do this go to your server terminal and enter the comand:

sudo chown -R www-data:www-data /path/to/wordpress/

To explain a bit, "chown" is the command to change the ownership of the files..
"-R" make the command recursive. Meaning... this will effect all files/folders inside the WordPress folder.

"www-data:www-data" this is a way of expressing USER:GROUP in the permissions. This gives user ownership to www-data and group ownership to www-data

"/path/to/wordpress" is the path from the root directory to get to your WordPress files.
an example may be: "/var/www/html/wordpress/" you will need to verify this is the case for your setup to see if your files are here.

Once the command executes, this should change the ownership of the web files to www-data and would allow apache to make changes (such as update WordPress and plugins) to the web files.

Further reading on file permissions can be found:

Also, this guide seems helpful, though I have not tested the article myself:

Hope this helps!

Have another answer? Share your knowledge.