title: WordPress 3.8: unable to locate wordpress content directory (wp-content)
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>Environment:</p>
  
  <ul>
  <li>WP 3.8 (multisite, subdirectory)</li>
  <li>Ubuntu 12.04 server</li>
  <li>vsftpd (so I can FTP my user)</li>
  <li>Way back when (when I didn't know what I was doing) I changed the whole /var/www/ directory permissions to gabe:gabe. I have since tried changing the wp-content dir to gabe:www-data and www-data:www-data without success. I have also tried using chmod 777 on wp-content, again without success.</li>
  </ul>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>So I've used up my bag of tricks at this point.</p>
  
  <p>------------- Edit: Alterations I made to wp-config -------------
  Per <a href="http://wordpress.org/support/topic/unable-to-locate-wordpress-content-directory-wp-content" rel="noreferrer">http://wordpress.org/support/topic/unable-to-locate-wordpress-content-directory-wp-content</a> I changed the wp-config.php to include:</p>
  
  <pre><code>if(is_admin()) {
      add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
      define( 'FS_CHMOD_DIR', 0751 );
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>The second piece of code I added to wp-config.php was:</p>
  
  <pre><code>putenv('TMPDIR='. ABSPATH .'tmp');
  define('WP_TEMP_DIR', ABSPATH . 'tmp');
  </code></pre>
  
  <p>Per <a href="http://wordpress.org/support/topic/unable-to-locate-wordpress-content-directory-wp-content?replies=15" rel="noreferrer">http://wordpress.org/support/topic/unable-to-locate-wordpress-content-directory-wp-content?replies=15</a>. This didn't break the site but didn't fix it either so I removed it.</p>