Yesterday I\'ve spent 5 hours straight discovering a seemingly unreasonable error \"failed to open stream. permission denied\", which was occuring after any operations of wr
In addition to the HumbleRat very useful answer, here is what solved my problem of Apache not allowed to write logs in dedicated directry :
# Allow write only to specific dirs
sudo chcon -t httpd_sys_rw_content_t /data/www/html/sites/mysite/logs -R
Source : https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/