Fix WordPress Plugin Installation Permission Issue


Problem

When attempting to install a plugin in WordPress, I encountered the following error:

Installation failed: Download failed. Destination directory for file streaming does not exist or is not writable.

This issue arises due to permission problems within the content folder. I had been editing some files as a superuser (sudo su), but the installation requires write access for the ec2-user.

Solution

Assuming you are setting up on AWS EC2 instances and are logged in as ec2-user, and assuming that WordPress is located in the /var/www path, execute the following command to change the ownership:

sudo chown -R ec2-user:apache /var/www

After changing the ownership, you should now be able to successfully install the plugin.