WordPress on EC2 Requires FTP Credentials

The main issue here is that apache does not have access to the folders. The default permission is given to the ec2-user in the AMI.

run this in your terminal and you should be good to go.

sudo chown -R apache:apache /var/www/html

or add this code in your wp config file

define('FS_METHOD', 'direct');