Recently I rebuilt a server using Digital Ocean. WordPress was installed and everything was working except trying to update or add plugin/ theme. This ‘error’ came up.

There are X method to overcome this.

1. Insert FTP Credentials.

Like duh, just insert your FTP credentials it will work just. Slightly different story if you are using port 22. The hostname should be ftp.your-domain.com:22. Only use FTPS (SSL) if you have one. Or you can add this line on your wp-config.php on your wordpress root folder.
[crayon]/* FTP Credentials in wp-config */
define(“FTP_HOST”, “domain-name”);
define(“FTP_USER”, “user”);
define(“FTP_PASS”, “password”);[/crayon] Note:┬áBe sure to change the credentials above.

But not many like this method because you are leaving your credentials on the server.

2. Insert FS_METHOD

Open your wp-config.php on the root folder of wordpress. Add this line in the file.
[crayon] /*FS Method added to bipass FTP*/
define(‘FS_METHOD’,’direct’);
[/crayon] If you are getting this error while trying to update

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

Installation Failed

It could be mean your file permission is wrong and as well as the ownership. Which brings us to the 3rd method.

3. Repair File Permission and Owner using Command Line

Launch your command prompt and SSH to your server. Type the following:

Reset all files permission to 664:
[crayon] > find /path/to/site/ -type f -exec chmod 664 {} \;[/crayon] Reset all folder permission to 775:
[crayon] > find /path/to/site/ -type d -exec chmod 775 {} \;[/crayon] Reset the ownership of group
[crayon] > chgrp -R wordpress /path/to/site/[/crayon]

Note: Change the “path/to/site” to you wordpress folder on your server.

After running those command, everything should be A-ok. Good luck

 

Leave a Reply

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