Home > Article > Operation and Maintenance > What should I do if the directory still cannot be written after changing the permissions under centos?
Problem description:
When setting up an environment on CentOS, no matter how you modify the user permissions to 777 or 755 or change the user to whom the file belongs, the Laravel framework always reports an error "The stream or file "/var/www/laravel56/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied".
Solution:
Just turn off selinux.
Edit the /etc/selinux/config file and modify the SELINUX item to: SELINUX=disabled
#This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted
Recommended tutorial: centos tutorial
The above is the detailed content of What should I do if the directory still cannot be written after changing the permissions under centos?. For more information, please follow other related articles on the PHP Chinese website!