WordPress updater uses the wrong remote base directory

  • Unknown's avatar

    Hi,

    I’m observing a bit of an odd quirk when using the updater to update a self-hosted WordPress install. I have two WordPress installations at the following locations:

    /var/www/example.com/test
    /var/www/example.com/www

    These serve WordPress at the following locations:

    http://www.example.com
    test.example.com

    This domain has a single SFTP-only user for managing the files. The updater is instructed to use it’s credentials using the SFTP updater plugin. This user is chroot jailed to /var/www/example.com, which means the absolute path to site files when logging in remotely is:

    /test
    /www

    The following FTP_* constants are set in wp-config.php for each site:

    test:
    define(‘FS_METHOD’, ‘ssh2’);
    define(‘FTP_BASE’, ‘/test’);
    define(‘FTP_CONTENT_DIR’, ‘/test/wp-content’);
    define(‘FTP_PLUGIN_DIR’, ‘/test/wp-content/plugins’);
    define(‘FTP_USER’, ‘www-example’);

    www:
    define(‘FS_METHOD’, ‘ssh2’);
    define(‘FTP_BASE’, ‘/www’);
    define(‘FTP_CONTENT_DIR’, ‘/www/wp-content’);
    define(‘FTP_PLUGIN_DIR’, ‘/www/wp-content/plugins’);
    define(‘FTP_USER’, ‘www-example’);

    Looks fine to me. But when running the updater on the test site, the updater will always go to the /www folder unless I rename it to something else. Eg. renaming /www to /www.bak makes the updater go to the correct /test directory.

    Is this a wordpress problem, or am I potentially missing something?

  • Hi there,

    We’re only able to help with sites hosted on WordPress.com in this forum.

    For help with the open source WordPress software, please ask here instead:

    https://wordpress.org/support/forums/

  • The topic ‘WordPress updater uses the wrong remote base directory’ is closed to new replies.