I figured out what was blocking write access in directories, it’s about Selinux, an implementation of the architecture MAC (Mandatory Access Control) for Linux that provides security policies on all cases.
Then it is necessary inform at the Selinux the directory that Apache will be using with the command:
sudo chcon -R -t httpd_sys_rw_content_t /var/www/Questionnaire/app/storage
Apache should be able to write in the Storage directory smoothly.
Although unsaved (for security reasons), it is also possible to disable the Selinux, following the steps below:
01. Check the status of Selinux.
$ sestatus
02. Disable Selinux only in current session.
$ sudo setenforce 0
03. Disable Selinux permanently.
03.01. Open the Selinux configuration file for editing
$ sudo vi /etc/selinux/config
03.02. Change the definition SELINUX for disabled.
SELINUX=disabled
03.03. Save the file and restart the operating system
$ sudo shutdown -r now
03.04. After restarting check the status of Selinux, it should be listed as disabled.
References:
- https://linuxize.com/post/how-to-disable-selinux-on-centos-7/
- https://en.wikipedia.org/wiki/Security-Enhanced_Linux
- https://tecadmin.net/install-laravel-framework-on-centos/
- http://gesielbernardes.eti.br/configurar-selinux.html