themes - FTP + Unable to locate WordPress content directory (wp-content)

When I try to upload a theme in my Wordpress website I need to fill in FTP credentials. I've installed vsftpd on my

When I try to upload a theme in my Wordpress website I need to fill in FTP credentials.

I've installed vsftpd on my Ubuntu 18.04 server. When I connect with the credentials in my FTP client (ex. Cyberduck on mac) I see the following:

The problem is when I try this in Wordpress I get the error FTP + Unable to locate WordPress content directory (wp-content).. What could be the problem here?

When I try to upload a theme in my Wordpress website I need to fill in FTP credentials.

I've installed vsftpd on my Ubuntu 18.04 server. When I connect with the credentials in my FTP client (ex. Cyberduck on mac) I see the following:

The problem is when I try this in Wordpress I get the error FTP + Unable to locate WordPress content directory (wp-content).. What could be the problem here?

Share Improve this question asked Jun 24, 2019 at 7:28 nielsvnielsv 1731 gold badge5 silver badges17 bronze badges 1
  • You're managing this server on your own, right? Instead of giving WordPress the FTP credentials, I would rather make sure the user PHP/WordPress is running as has access to these files. Usually you can do this by doing sudo chown -R www-data:www-data . – kero Commented Jun 24, 2019 at 8:24
Add a comment  | 

2 Answers 2

Reset to default 2
  • All files should be owned by the actual user's account, not the user account used for the httpd process.
  • Group ownership is irrelevant unless there are specific group requirements for the web-server process permissions checking. This is not usually the case.
  • All directories should be 755 or 750.
  • All files should be 644 or 640. Exception: wp-config.php should be 440 or 400 to prevent other users on the server from reading it.
  • No directories should ever be given 777, even upload directories. Since the PHP process is running as the owner of the files, it gets the owners permissions and - - can write to even a 755 directory.

You can use

chown www-data:www-data  -R * 
find . -type d -exec chmod 755 {} \;  
find . -type f -exec chmod 644 {} \;

you can also trying the following

add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
define('WP_TEMP_DIR', ABSPATH . 'wp-content/tmp');

The tmp folder wasn't having the permission and that caused the website plugins from updating.

You might be on one of those servers which move the /wp-content/ directory one level up for security purposes.

Did you ask the hosting provider for these details? Where are you hosted?

UPDATE: Check your wp-config.php file for these details:

define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/../wp-content' );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp-content' );

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745375281a4624969.html

相关推荐

  • themes - FTP + Unable to locate WordPress content directory (wp-content)

    When I try to upload a theme in my Wordpress website I need to fill in FTP credentials. I've installed vsftpd on my

    3小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信