Try to add the code in wp-config.php:

define('FS_METHOD', 'direct');


or

If you are using Ubuntu.

sudo chown -R www-data:www-data PATH_TO_YOUR_WORDPRESS_FOLDER