Cuople days ago I tried to automatically upgrade one of my Wordpress blog on Hostlemon.com free hosting, but it’s failed due to this warning:
Unable to locate WordPress Root directory.
Installation Failed

Then I opened the File Manager and check the wordpress directory structure, I found that the Wordpress file is not located on htdocs folder (html_public). This is the default settings done by some free hosting provider such Hostlemon.com.

To handle this error, I add these codes to the wp-config.php that located on root directory:
if(is_admin()) {
add_filter(’filesystem_method’, create_function(’$a’, ‘return “direct”;’ ));
define( ‘FS_CHMOD_DIR’, 0751 );
}

Put it before the :
?>

Hope it helps you too!