Updating WordPress

At some point after migrating this site to WordPress, the admin panel notified me of an available update. When I attempted to install the update, I was prompted for FTP credentials. I don’t have an FTP server configured, so I had to dig into the problem. A quick search turned up a lot of people with similar problems, though most report also having trouble installing and updating plugins. That’s working just fine for me.

One option I came across is to hard-code the FTP credentials in your wp-config.php file. That doesn’t seem like a great idea to me, and it would also involve setting up an FTP server.

It appears that the root of the issue is a file permissions (or ownership) problem. I need to learn more about the ownership model in Linux, and what it should look like for a WordPress install.

In the meantime, the simplest fix seems to be to add a single line to your wp-config.php file: define(‘FS_METHOD’,’direct’);

I wasn’t entirely sure what that did, which made me a little uneasy — so I removed that line again after I completed the update. There’s a pretty good explanation of how this works on Stack Overflow. It seems like the crux of the issue is that the test for the direct method is failing, but the direct method actual works just fine. By directly specifying that update method I’m just bypassing that test.

Since I haven’t resolved the underlying permissions issue, I’m sure I’ll be diving into this again at the next major version release. This document details the permissions scheme in WordPress; hopefully it will help me sort this out.

Update March 16, 2016: I looked into the permissions issue a little more, and found that the group assigned to all of the subfolders in /var/www/jeffvautin.com/ did not match the groups in /var/www/analogbias.com/, the other WordPress site I have installed on this server. I ended up making a call to chgrp to set all of the folder groups to www-data. This did the trick.