How to solve the problem of:
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed.
Not necessarily that you’re not filling in your hostname, ftp username and ftp password wrong. It might be prompting you because it doesn’t have the authority to change files as it needs to.
Simply do:
sudo chown -R www-data:www-data /var/www
And on OSX with MAMP, see here.