Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#41831 closed defect (bug) (duplicate)

"Unable to locate WordPress Content directory (wp-content)" with ssh2

Reported by: mangoo's profile mangoo Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8.1
Component: Filesystem API Keywords:
Focuses: Cc:


I'm getting "Unable to locate WordPress content directory (wp-content)" when using ssh2 FS_METHOD and trying to update plugins.

I've tried setting the following to wp-config.php:

define( 'FTP_USER', 'sftpuser' );
define( 'FTP_HOST', 'localhost' );
define( 'FS_METHOD', 'ssh2' );
define( 'FTP_BASE', '/' );
define( 'FTP_CONTENT_DIR', '/wp-content/' );
define( 'FTP_PLUGIN_DIR ', '/wp-content/plugins/' );


define( 'FTP_USER', 'sftpuser' );
define( 'FTP_HOST', 'localhost' );
define( 'FS_METHOD', 'ssh2' );
define( 'FTP_BASE', '/server/path/to/wordpress/' );
define( 'FTP_CONTENT_DIR', '/server/path/to/wordpress/wp-content/' );
define( 'FTP_PLUGIN_DIR ', '/server/path/to/wordpress/wp-content/plugins/' );

However, in both cases, the result is "Unable to locate WordPress content directory (wp-content)".

When I sftp to the server, I get:

# sftp sftpuser@localhost
sftpuser@localhost's password: 
Connected to localhost.

sftp> pwd
Remote working directory: /server/path/to/wordpress/

sftp> ls
index.php             wp-activate.php       wp-admin              wp-blog-header.php    wp-comments-post.php  wp-config-sample.php  wp-config.php         wp-content            wp-cron.php           
wp-includes           wp-links-opml.php     wp-load.php           wp-login.php          wp-mail.php           wp-settings.php       wp-signup.php         wp-trackback.php      xmlrpc.php    

Tried debugging it with strace, but wordpress doesn't even seem to access "wp-content" dir in any way.

Not sure what other information I should provide to debug this further.

Change History (5)

#1 @mangoo
7 years ago

Also tried without specifying FTP_BASE, FTP_CONTENT_DIR, FTP_PLUGIN_DIR with the same effect.

#2 @dd32
7 years ago

  • Keywords reporter-feedback added

Hey @mangoo,

This sounds like #35517 - PHP7 / the ssh2 extension not being compatible with each other, can you confirm that you're running an affected version?

#3 @dd32
7 years ago

  • Component changed from General to Filesystem API

#4 @mangoo
7 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #35517.

You are right, updating ssh2 extension fixed this!

#5 @SergeyBiryukov
7 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.