WordPress.org

Make WordPress Core

Opened 23 months ago

Closed 23 months ago

Last modified 22 months ago

#41831 closed defect (bug) (duplicate)

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

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

Description

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/' );

or:

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
23 months ago

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

#2 @dd32
23 months 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
23 months ago

  • Component changed from General to Filesystem API

#4 @mangoo
23 months ago

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

Duplicate of #35517.

You are right, updating ssh2 extension fixed this!

#5 @SergeyBiryukov
22 months ago

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