SELinux influences "failed to open stream: Permission denied” PHP error

前端 未结 2 972
忘了有多久
忘了有多久 2021-01-05 11:27

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

2条回答
  •  粉色の甜心
    2021-01-05 12:10

    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/

提交回复
热议问题