If you’re want to take advantage of the automatic upgrade facility built into WordPress but each time are being asked to enter details of your FTP connection, it is probably because the webserver user is not the owner of the files that need to be upgraded. This includes the WordPress core files.
If you see the following screen when you press the Upgrade button, it is likely that this is your problem
How to solve this problem?
- Login to your webserver
- Find out the user for your webserver, if you are running an Apache webserver
ps aux | grep apache will reveal this to you.
- Go to the document root, (usually /var/www)
- Use the chown command to change the owner of your website directory to the same as your webserver user. So if your wordpress files are in a directory called mywebsitewordpress and your apache server is running under the www-data user, the chown command would be
chown www-data.www-data mywebsitewordpress/ -R
- Now the automatic update will run without asking for your connection credentials