I was trying to edit a file using the PHP file_put_contents but I was recieving a permission denied response. To fix this I thought that the folder didn't have the correct permissions. Using the
on the folder would fix it.
-rwxr-xr-x 1 root root 2284 Jan 16 13:04 index.html
chown apache:apache index.html
This should now allow your files to be edited by your website.
-rwxr-xr-x 1 apache apache 2284 Jan 16 13:04 index.html