Solution to fix WordPress update failure issue

I was having problem while updating one of my plugin weeks ago, telling me that

Could not create directory. /home/<>/public_html/wp-content/plugins/download-manager
Plugin install failed.

or

Unable to locate WordPress Content directory (wp-content).

By then, I turned to Google for solutions, however, tried every way I got, such as:

  • 1. Remove the plugin and re-install it.
  • 2. Change permission of wp-contents direcotry and sub-directories to 777
  • 3. Change the ftp accout of wp-config.php

But none of them can fix my problem, so I have to upload the plugin mannually, and got it fixed.

Days ago, WordPress 4.1.1 is released, and a bunch of plugin updated. When I tried to update them turned out none of them can be updated.

So I can not avoid it now.

Obviously, this issue is permission relevant. After digged more into the issue, finnally got a solution for it, and this is the antidote, fix it by adding the following code to the end of your wp-config.php

if(is_admin())
{
    add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
    define( 'FS_CHMOD_DIR', 0751 );
}

Share with u.

Author: Jacky Wei

I am a programmer, welcome to my blog: http://rg4.net.

2 thoughts on “Solution to fix WordPress update failure issue”

  1. This paragraph will assist the internet visitors for
    creating new webpage or even a blog from start to end.

  2. I am genuinely grateful to the owner of this site who has
    shared this enormous piece of writing at at this place.

Leave a Reply

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