Unable to update WordPress or install plugins/themes

I can't update WordPress from the back-end or install themes or plugins. Each time I try, I got this type of error: Unable to locate WordPress Root directory..

I've installed my WordPress in a sub-directory. I have /conclave folder for WordPress files and /content for themes, plugins and uploads. My WordPress works fine, I can write posts, pages, and upload medias.

To allow me to update WordPress from the back-end, I've followed this tutorial. I'm quite lost about what to do and what's going on. I've check multiple things on the internet without success. Can you tell me what's going on ?

Here is the part of my wp-config.php file about the custom paths

/**
 * Set custom paths
 *
 * These are required because wordpress is installed in a subdirectory.
 */
if (!defined('WP_SITEURL')) {
  define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/conclave');
}
if (!defined('WP_HOME')) {
  define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] . '');
}
if (!defined('WP_CONTENT_DIR')) {
  define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/content');
}
if (!defined('WP_CONTENT_URL')) {
  define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/content');
}

/** Absolute path to the WordPress directory. */
define('ABSPATH', dirname(__FILE__) . '/conclave');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Topic ssh directory Wordpress

Category Web


I've seen this happen when WP doesn't like the file owner. Can you change it to www-data and check file permissions? https://codex.wordpress.org/Changing_File_Permissions

Or it could be that WordPress is getting confused by your /content folder, which is normally /wp-content. Have you defined WP_CONTENT_URL in wp-config.php? http://www.hongkiat.com/blog/renaming-wordpress-wp-content-folder/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.