Support » Plugin: SSH SFTP Updater Support » Update Failed: Unable to locate WordPress content directory (wp-content).

  • Resolved kadbar

    (@kadbar)


    When trying to update plugins/themes/WP, it says: Update Failed: Unable to locate WordPress content directory (wp-content).
    Does it have anything to do with my installation path?
    My wordpress folder is available by SFTP through the following path
    /public_html/wordpress/wp-content/plugins
    so it has a /public_html/ in the path, which is the topmost folder I have access to. Is that something the plugin may find an obstacle?
    And where can I set the default path?
    Best regards,
    Barnabas Kadar

    The page I need help with: [log in to see the link]

Viewing 5 replies - 16 through 20 (of 20 total)
  • With plugin version 0.8.2 … some additional observations.

    I have a chrooted setup on Ubuntu for my WP accounts and sites.

    I use an absolute path for FTP_BASE and it works.

    If I define this constant (below) then updates fail with permission violations on specific files.
    define (‘FTP_CONTENT_DIR’, ‘/var/www/wp_chroot/wpdocroot/wp-content/’);

    FOR EXAMPLE trying to update Yoast SEO I get:
    Update Failed: Could not copy file. wordpress-seo/admin/ajax/class-recalculate-scores-ajax.php

    If I use a path -relative to the chroot directory- then sometimes updates succeed.
    define (‘FTP_CONTENT_DIR’, ‘wpdocroot/wp-content/’);

    Note that because this is chrooted, I use relative to wp_chroot, not relative to the docroot of the WP site.

    If I also define FTP_PLUGIN_DIR it fails. Go figure.

    Also I like the idea of having the SSH2 password filled in automatically, but I do not like having it in plaintext in a configuration file, so I don’t put it in wp-config.php although in the past that has functioned.

    Your chroot setup seems a bit strange to me though it could work as well.

    This is how I have it setup:
    /etc/ssh/sshd_config:

    Match User your_wordpress_user
     ChrootDirectory /home/your_wordpress_user
     ForceCommand internal-sftp -u 0027
     X11Forwarding no
     PermitTunnel no
     AllowTCPForwarding no

    /etc/fstab:
    /var/www/wordpress /home/your_wordpress_user/wwwroot none bind 0 0

    The user directory with the bind mount looks like this:

    root@webserver:~# ll /home/your_wordpress_user/
    total 68
    drwxr-xr-x  7 root                your_wordpress_user     4096 Jän 22 11:43 ./
    drwxr-xr-x 13 root                root                    4096 Apr 23 11:49 ../
    drwx------  2 your_wordpress_user your_wordpress_user     4096 Jul 10 16:12 .ssh/
    drwxr-s---  6 your_wordpress_user www-data                4096 Jul 10 16:13 wwwroot/

    Note the s bit, which also applies to all other directories below.

    The only thing that does not correctly work with this setup are the permissions of files that get created. They have o+r set, which is not what the sftp umask 0027 implies.. WordPress seems to explicity set this somewhere, which is nonsense.
    umask(0027);
    in wp-config.php sadly also does not fix this.
    Directories get created correctly, though (with o-rwx).

    The wp-config.php can be seen in my last post.

    I am doing a paper on WordPress and with no knowledge of programming trying to make my first site and learn how, and at the moment I stumbled upon a problem Installation failed: Unable to locate WordPress Content directory (wp-content). when trying to install the theme I chose for it. Could you please be so kind to explain to me in simple words how to solve this? I didn’t even know how to install wordpress so I am using the 000webhost.com site which automatically installed WordPress. Please help and dumb it down for me 🙂

    I doubt you use the SSH SFTP Updater Support plugin, or do you?
    If not, this is the wrong place to ask.

    We just ran into this issue but on a core basis, nothing to do with the plugin. We have removed FS_METHOD from wp-config.php and all of a sudden, it works. Maybe this helps someone.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Update Failed: Unable to locate WordPress content directory (wp-content).’ is closed to new replies.