I had my server setup just fine to allow me to update plugins, themes, and the core via the nice buttons WordPress provides. However, after upgrading to 3.8 I have not been able to upgrade anything. However, I also added iptables to the server around the same time but I don't think this is the issue - I shut off iptables and tried but didn't have any success.
When I attempt to upload the plugin/update via WordPress's FTP it can't connect via localhost. Both 127.0.0.1 and the public IP return the "unable to locate wordpress content directory (wp-content)" after a long, long time suggesting a timeout or several timeouts.
Environment:
I have googled and the vast majority of the fixes come down to permissions. However, as I stated above I've tried changing the owner and the permissions to 777 for the directory. So, I think permissions is a dead end.
I originally thought iptables was somehow getting in the way. But I've shut it off/flushed the table without success. So I don't think iptables is the culprit.
The other googled solutions amounted to adding some code to the wp-config.php file. However, one of those broke the site entirely. Another had no effect.
The logs for Apache and the domain show nothing. They aren't empty but there isn't a single reference to wp-content or anything I can think of that would be related. The ftp logs show that a connection was successfully established via 127.0.0.1.
So I've used up my bag of tricks at this point.
------------- Edit: Alterations I made to wp-config ------------- Per http://wordpress.org/support/topic/unable-to-locate-wordpress-content-directory-wp-content I changed the wp-config.php to include:
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
}
This was a solution presented for the same problem back in WordPress 2.8 some 4 yrs ago. The site wouldn't load after adding these lines and given the age of the post/solution I took them out and did no further troubleshooting on why the site wouldn't load. I assumed it was calling some function that wasn't present in WP any longer.
The second piece of code I added to wp-config.php was:
putenv('TMPDIR='. ABSPATH .'tmp');
define('WP_TEMP_DIR', ABSPATH . 'tmp');
Per http://wordpress.org/support/topic/unable-to-locate-wordpress-content-directory-wp-content?replies=15. This didn't break the site but didn't fix it either so I removed it.
Adding this line to my wp-config.php
worked.
define('FS_METHOD', 'direct');
I have a local development environment on an Ubuntu server.
Try adding this line into your wp-config.php, it works for me
define('FS_METHOD', 'ftpsockets');
define('FTP_BASE', 'xxx');
Replace the xxx with your ftp home path e.g /opt/htdocs/wordpress
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With