December 2024
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

December 2024
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

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 );
}

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>