Unable to get WordPress auto update working on Ubuntu 12.04

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.

Read More

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?

Related posts

1 comment

  1. 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 );
    }
    

Comments are closed.