I have tried to update my plugins in wordpress-admin but for some reason i am receiving an error "Unable to locate WordPress Content directory (wp-content)" I have checked on my server and the folder still exists. What is this cause of this and is there a quick fix?
-
Try defining the constant in wp-config.php - WP_CONTENT_DIR - codex.wordpress.org/Determining_Plugin_and_Content_Directories– jgraupJul 27, 2016 at 4:48
-
I recently got the same error I wonder if it was because I upgraded to PHP 7.0– Archimedes TrajanoDec 21, 2016 at 1:53
4 Answers
I had the same issue, this is usually a permission of writing in specific folder, in my case I had to change the owner of the uploads/
directory, here is what I did in wp-content
directory:
sudo chown -R daemon uploads/
where the user daemon
is the owner of the process httpd
.
Hope this helps.
Adding below code to wp-config.php
file will solve your problem:
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
}
Above is quick fix I found on Wordpress support but problem is with permissions.
For details please follow link
Please check you permissions:
All FILES should have permissions set to 644
All DIRECTORIES (i.e. folders) should have permissions set to 755
Thanks!
-
Added to functions now it says "The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions. "– T2TOct 20, 2015 at 11:57
-
Please try to check permission of your folders, according to updated answer.– jasOct 20, 2015 at 12:02
-
Please follow this link to check with permissions stackoverflow.com/questions/18352682/…– jasOct 20, 2015 at 12:04
Also had this error and it was because of server FTP and NAT configuration and I was updating WordPress via FTP. Changing the WP update page to use the IP address of the web server instead of the domain name of the web site solved the problem.
If you are using IIS to host your site, open the file explorer on the server and right click on your website (WordPress) folder. Select Properties --> Security and edit the "USERS" permissions to enable Read, Write, List, and Modify privileges.
Doing this also fixed my issue with importing content data.