处理file_put_contents failed to open stream

在运行时出现了如下错误:php

ErrorException in Filesystem.php line 81:file_put_contents(/var/www/mysite/bootstrap/cache/services.json): failed to open stream: Permission denied


从上边的报错能够看出是因为cache目录没有写入的权限,因此给这个目录写入权限:shell

解决方法:json

# sudo chmod -R 777 /var/www/mysite/bootstrap/cache

权限777和755区别:bootstrap

777是全部用户都有执行,读,写权限,755是root用可执行权限.文件所属用户和其它组用户没有执行权限!spa

相关文章
相关标签/搜索