Word press update not working

I have another web site that uses Word press which had stagnated for a year and when I went back to it, there was updates required. I clicked the update button, and it asked me for ftp details.

This seemed strange. At first I assumed that it was asking me where to get the update from (how should I know?). Reading more carefully, it was asking me for access to my own ftp site, which I did not have.

Time to search the Internet.

The LornaJane website gave the answer – File permissions. The problem appears to be that WordPress finds that it cannot overwrite files, so it goes into manual install mode but not telling the user it has found a problem.

When WordPress was first installed, the permissions would have been correct, but as we all know, upgrades, reorganisations, restores, etc all mess up the general configurations – thats what system administrators are for!

WordPress, along with all other content management systems and any other web software are manipulated by whatever http software that is running. This software, for example Apache or IIS, is the one that requires write permission for any updating.

Normal day to day running of a WordPress website only requires reading of files as writing of information is done to a mySQL server with its own user permissions. When an update is required, it has to overwrite the program files which no longer are owned by the web server software.

The following fix applies to linux apache servers running content management systems or generally any type of scripted website

The fix is easy enough but you need to discover the user name of the apache server as it will vary between installations, versions, linux flavours etc. First, you will need root access to your linux server and run the command ps -ef which will show all the processes running on your server.

You need to find the process that runs apache, depending on the flavour of linux this may be called apache or httpd or something else (good luck).

Heres mine

root 28834 1 0 2010 ? 00:00:13 /usr/sbin/apache2 -k start
www-data 31034 28834 0 13:37 ? 00:00:02 /usr/sbin/apache2 -k start
www-data 31115 28834 0 13:51 ? 00:00:03 /usr/sbin/apache2 -k start
www-data 31323 28834 0 14:24 ? 00:00:01 /usr/sbin/apache2 -k start

The root process is the parent which spawned the three apache processes owned by the www-data user. This is the user that needs control of the program files – again this will vary depending on installation.

So now we know what user needs permission, we have to set all files to be owned by that user, www-data in my case. Go to the directory where your web files are stored and enter the command chown -R {user-name}.{user-group} * (-R = recursive)

In my case

chown -R www-data.www-data /var/www/yeogle

Hopefully, next time you run an WordPress update, it will just happen and no longer display the ftp message. To fix my problem, I only had to change file ownership. Incorrect file permissions could cause the same problem if someone has removed all write permission, however incorrect file permissions are more likely to make the system less secure rather than break the website.

I have left a few things out like how you find the user-group (try looking in /etc/group) or expanding on file permissions, but feel free to ask questions in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.