WordPress.org

Ready to get started?Download WordPress

Forums

SSH SFTP Updater Support
No wp-content directory (9 posts)

  1. msuemnig
    Member
    Posted 2 years ago #

    I'm getting the following message when trying to install a new plugin.
    ---begin message---
    Unable to locate WordPress Content directory (wp-content).
    ---end message---

    I tested with Filezilla with the same connection information (using SFTP) and it put me right at the site root and I can see the /wp-content directory. I then created a file and a directory then deleted both so I know I (this sftp user) have write/modify rights to the directory.

    Also, if I try to update the akismet plugin to version 2.5.6 from 2.5.3, it pretends like it succeeds (finishes with no error messages), but when I view the plugin again, it still says 2.5.3 and tells me to update.

    Any thoughts? Thanks for your help in advance!

    http://wordpress.org/extend/plugins/ssh-sftp-updater-support/

  2. nipponese
    Member
    Posted 2 years ago #

    Same problem.

  3. alittlenegative
    Member
    Posted 2 years ago #

    Same with me.

  4. TerraFrost
    Member
    Plugin Author

    Posted 1 year ago #

    Here's a script that'll help me diagnose this:

    <?php
    include('Net/SFTP.php');
    
    $sftp = new Net_SFTP('www.domain.tld');
    if (!$sftp->login('username', 'password')) {
        exit('Login Failed');
    }
    
    echo dirname(__FILE__) . '<br />';
    echo $sftp->pwd();

    What I'm thinking is that the SFTP server is chroot'd but Apache isn't. So dirname() is returning something like /home/user/public_html/wordpress whereas $sftp->pwd() is returning something like /. If that's the case one thing that could be done is to set up /home/user as a symlink to /.

  5. dizzysoul
    Member
    Posted 1 year ago #

    Hello. I'm having this same problem. I am using nearlyfreespeech.net as a host. What do I have to do with the script you posted above to help you diagnose and fix this issue?

    I'd really like my wordpress installation to be able to update through SSH, which nearlyfreespeech requires for security reasons. Please let me know how to help. Thank you!

  6. TerraFrost
    Member
    Plugin Author

    Posted 1 year ago #

    Just run it and tell me what the output of it is.

    Thanks!

  7. brettwilliams101
    Member
    Posted 1 year ago #

    Hi TerraFrost,

    I have run your diagnostic script on my shared hosting plan... I get a very deep home directory for the first line. The second line, as you suggest is the root, which seems to be relative to the home directory, not its true location on the server.

    That being said, I do not have shell access with this shared hosting plan, so creating a symbolic link is not possible. Is there a place in your code where I can hard code a reference to it?

    Thanks in advance for your assistance.

  8. TerraFrost
    Member
    Plugin Author

    Posted 1 year ago #

    #
    #-----[ OPEN ]------------------------------------------
    #
    class-wp-filesystem-ssh2.php
    #
    #-----[ FIND ]------------------------------------------
    #
    		$this->link = new Net_SFTP($this->options['hostname'], $this->options['port']);
    #
    #-----[ AFTER, ADD ]-------------------------------------
    #
    		$this->link->chdir(dirname(__FILE__) . '/../../../');

    I think that should work. I don't have the ability to test it atm though (am at work).

  9. brettwilliams101
    Member
    Posted 1 year ago #

    Thanks for the reply... no luck though. I tried many variations of this, up to 13 parent directories up (that is how deep the plugins directory is on the web server). Even tried putting in the literal path to WP.

    One other important fact - my host doesn't allow an interactive SSH, though it does allow SFTP.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic