Permissions Issue with Laravel on CentOS

前端 未结 6 2033
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 00:35

I\'ve cloned a laravel repo to my CentOS 7 box. When I try to run it, I get a 500 error with nothing displayed.

So I check out /var/log/httpd/error_log

6条回答
  •  遥遥无期
    2020-12-01 00:50

    I need to make more adjustments for SELinux than just for storage. Especially the config dir can get you this issue on Laravel bootstrapping.

    If you sudo setenforce permissive and it works, then turn it back sudo setenforce enforcing then follow below.

    SELinux laravel setup:

    sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/site/laravel/storage(/.*)?"
    sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/site/laravel/bootstrap/cache(/.*)?"
    
    

    You may not need the following one for config, but i did. It may be safest not to run this one unless you need to:

    sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/site/laravel/config(/.*)?"

    Then Reset after your dir adjustments have been made:

    restorecon -Rv /var/www/site/

提交回复
热议问题