WordPress using ‘www-data’ as user in updates – how do I change this to another user?

I have a WordPress 3.2.1 install on an Amazon EC2 Ubuntu instance.
My WordPress install is at

/var/www/blog/

Read More

Besides numerous issues I’m having with permissions etc, one thing that has stumped me is that when trying to do plugin updates, I get a window asking for FTP credentials. This is overridden by using

if(is_admin()) {
    add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
    define( 'FS_CHMOD_DIR', 0751 );
}

at the end of wp-config.php.

But althought this allows for a full plugin update – without FTP credentials – I noticed on CLI that instead of my regular user ubuntu owning the files/folders of updated plugin, now it’s www-data (Apache’s daemon).

This is problematic since I am never logged in as www-data (and wouldn’t want to) and then can’t make any changes to the updated plugin.

Anyone know how to solve this issue?

Related posts

Leave a Reply

1 comment