Error message “to perform the requested action, WordPress needs to access your web server”

Add the following to wp-config.php:

define( 'FS_METHOD', 'direct' );