If you need to go update WordPress through the WordPress updates page, and you’re presented with a message similar to the below:
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed.
If you’re getting asked to input your FTP credentials to update WordPress, you need to update the permissions on the webroot where WordPress lives. Usually this is in the /var/www directory so if yours is different, you’ll need to modify the below command to reflect the directory where WordPress is installed.
You don’t even need to restart Apache for this to take affect. You should be all set after this.