I moved from a shared hosting to a VPS a few weeks ago and I'm having these annoying permission issues with WordPress. You know you can download and upgrade plugins (and wordpress itself) from the admin panel, but since I moved it started asking me my FTP credentials, which is kinda slow when I have to update ~20 plugins.
I think this should be some kind of rights issue. I looked that the shared hosting wordpress files, they all belong to the username and group kovshenin (kovshenin:kovshenin) and the files are -rw-r--r-- and the directories are drwx-r-xr-x.
On my VPS apache runs under apache:apache and my files are kovshenin:kovshenin. What should I do to make them readable and writable by both kovshenin and apache?
Also, I changed the permissions to 0777 for all files and folders of my wordpress installation, that allowed me to install and delete plugins without FTP, but when I pushed to automatic upgrade to WordPress 2.8.1 it still asked me for my FTP account. Is that a wp issue or did I miss something?
Thanks.
Update: I managed to run id
and id www-data
on the MediaTemple shared hosting. User kovshenin is in group kovshenin, and www-data is in group www-data. No more groups. What's the trick?
Another update Okay, I added the apache
user to the kovshenin
group, my wordpress files are kovshenin:kovshenin
with rw-rw-r--
permissions and drwxrwxr-x
permissions on directories, but something is still wrong. The user apache
can access the files and folders, I can use the online Themes and Plugins editor in the wordpress admin panel, I'm able to make changes to the .htaccess file from within wordpress, but plugin/theme installation still asks me for FTP credentials!
Any ideas? Thanks.
Generally, WordPress directory and folder permissions should be set to 755, and most file permissions need to be set to 644. These are also the file permissions that WordPress recommends you set for your site. These are also the permissions needed for WordPress auto update to function correctly.
Three file permissions types apply to each class of users: The read permission. The write permission. The execute permission.
htaccess permissions is 644, which is what the WordPress Codex recommends. Some developers also recommend 444. However, if you use 444, it might restrict plugins that need to write to the . htaccess file (such as most caching plugins).
777 - all can read/write/execute (full access). 755 - owner can read/write/execute, group/others can read/execute. 644 - owner can read/write, group/others can read only.
What should I do to make them readable and writable by both kovshenin and apache?
The second last step is the trick. It means that whenever kovshenin or apache creates a file in those directories, the group owner will be set to wordpress (instead of kovshenin or apache).
You can give ownership to www-data according to here.
Run the following command in your WordPress directory (sudo required):
sudo chown -Rf www-data *
Works for Apache.
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