[wp-trac] [WordPress Trac] #40195: No provision to set paths for sftp (ssh2)

WordPress Trac noreply at wordpress.org
Sat Mar 18 13:36:01 UTC 2017


#40195: No provision to set paths for sftp (ssh2)
----------------------------+-----------------------------
 Reporter:  fsrs            |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Filesystem API  |    Version:  4.7.2
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 I have a server which has different paths for the web server verses when
 accessed via sftp and consequently updates fail with "Unable to locate
 WordPress content directory (wp-content)."

 According to this page [https://codex.wordpress.org/Editing%20wp-
 config.php#Enabling_SSH_Upgrade_Access]  there are 3 options for this
 exact purpose: FTP_BASE, FTP_CONTENT_DIR, FTP_PLUGIN_DIR.

 Setting these has no affect.

 This is confirmed by turning on debug and the following error is
 generated:
 "Installation failed: Looking for /usr/local/www/+++++/www/wp-
 content/plugins in /"

 The "wp-admin/includes/class-wp-filesystem-base.php" file reveals the
 find_folder function only processes the overrides for ftp services.

 {{{
         public function find_folder( $folder ) {
                 if ( isset( $this->cache[ $folder ] ) )
                         return $this->cache[ $folder ];

                 if ( stripos($this->method, 'ftp') !== false ) {
                         $constant_overrides = array(
                                 'FTP_BASE' => ABSPATH,
                                 'FTP_CONTENT_DIR' => WP_CONTENT_DIR,
                                 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR,
                                 'FTP_LANG_DIR' => WP_LANG_DIR
                         );
 }}}

 Seems to be a strange requirement on the ssh2 method that the paths must
 align exactly with the web server so I consider this a bug. Others may
 consider it an enhancement in which case it would be a good idea if the
 codex entry made it clear only ftp access methods support configurable
 paths (ssh must align with the webserver).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40195>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list