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?
2 Answers
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' );
sudo chown -R www-data:www-data .
– kero Commented Jun 24, 2019 at 8:24