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
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/