How to fix the issue with Wordpress updates on Synology

From the Blog

Jul
20

How to fix WordPress update and plugins on your Synology box

Posted by Paul Costan on July 20th, 2018 at 1:22 pm

This is the issue I was getting when trying to update plugins:

Using WP 4.9.6 I update an plugin resulting in:
Updating Plugin Akismet Anti-Spam (1/1)
Downloading update from https://downloads.wordpress.org/plugin/akismet.4.0.7.zip…
Unpacking the update…
Installing the latest version…
Removing the old version of the plugin…
Plugin update failed: Could not remove the old plugin.

And this was the error I was getting when trying to update WordPress:

The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

First, you need to ssh in your Synology box

This login as your superadmin
sudo -i

Then you need to change your WordPress site folder group/user
chown -R http:http volume1/web/your-wp-site

Finally you need to add the below line to `wp-config.php`
/** Set up ‘direct’ method for wordpress, auto update without FTP */
define(‘FS_METHOD’, ‘direct’);

And that’s it! Good luck! If updates still fail check your site file/folder permissions.