WordPress updates without providing FTP credentials
Rob — May 16, 2012 - 23:32
If you are like me and want to have WordPress perform updates from the admin section (and not provide FTP credentials) then you will probably want to know a few linux commands.
Hopefully you have shell access to your server because you will need to run some linux commands to get this working. Some hosting providers do not allow SSH access by default, but they may provide the ability for you to turn it on in your web hosting admin panel or by asking a tech support person. In shared hosting, the commands you run are usually limited to your own root folder - that should be fine. Let's move on..
WordPress has the ability to update itself using some cool PHP scripts, but it requires that the 'user' running the web server has ownership of the files and folders in which WordPress is installed. I will assume that the web server is Apache (because it is the most popular). I tend to appreciate Cherokee (http://www.cherokee-project.com/) more than Apache because of its really neat web admin and speed.
So, the first step is to figure out which 'user' is running your web server. So you would run this command:
ps aux | grep apache
Look in the left column for the user (usually not root). Mine came up as www-data.
The next step is to change file / folder user ownership to the user running the web server:
chown -R www-data /var/www/yourdomain.com
The root folder of the website (in my case it is /var/www/yourdomain.com) may be different on your server. If you wish to also change the group, you would add the group after the user (separated by a colon):
chown -R www-data:www-data /var/www/yourdomain.com
You may also need to change file permissions to user and group writeable (775). This is how it is done:
chmod -R 775 /var/www/yourdomain.com
You may find this page useful: http://codex.wordpress.org/Updating_WordPress