Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm getting a tiny bit fed up with having to chown 777 my entire Wordpress folder in order to auto update a plugin, and then set the permissions back again. I've looked around for fixes now, but no fix I try seems to work.

I'm on an Amazon EC2 instance running Ubuntu 12.04. So, the Apache2 installation is stock standard out of the box, runs as the www-data user.

I've set my owner:groups to my entire project to ubuntu:www-data, and the permissions through the bank is set to ***rwxrwx--r**, or 774, meaning that either the ubuntu user, or the www-data group will have full read/write access to the file structure.

Whenever I try to update Wordpress however, it asks me for FTP/SFTP details, so in order to get that going away, I need to run chown -R 777 ... on the entire project folder.

That's annoying, and I've got no clue as to why this is happening. How can Wordpress execute something other than the Apache2 user?

share|improve this question
2  
At this time there are more than 31000 posts tagged "wordpress" at Stackoverflow... Is Stackoverflow gonna move all of them here too? For goodness sake, I don't want a 101 profiles lying everywhere, and I'm probably not going to ask a lot of Wordpress questions. Maybe it's time for me to start using a different QA service that don't move your questions to another site just because they feel like it. Your stupid WhateverExchange rules and regulations are starting to piss me off. –  josef.van.niekerk May 17 '13 at 7:11
add comment

migrated from stackoverflow.com May 16 '13 at 19:52

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 4 down vote accepted

Found a fix. Simply add the following snippet to functions.php for your theme:

if(is_admin()) {
    add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
    define( 'FS_CHMOD_DIR', 0751 );
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.