Generally in ubuntu changing ownership to www-data
and 775
permission solve this problem. But in centos 8 this seems not enough. What I did is-
- Set SELinux in permissive mode
- Allow to write in the laravel storage folder – chcon -R -t httpd_sys_rw_content_t storage
- sudo chown -R nginx:nginx /path/to/your/laravel/root/directory
- chmod -R 775 storage/
- Reboot the system
Nothing is working. What to do solve this problem?
3
Answers
From the projects root folder try:
In CentOS I just solved with this:
chcon -R -t httpd_sys_rw_content_t storage/
Credits: https://laravelquestions.com/2020/10/27/laravel-the-stream-or-file-storage-laravel-log-could-not-be-opened-in-append-mode-failed-to-open-stream-permission-denied-in-rhel8/#google_vignette
Turns out the issue is with selinux
This worked for me