原文地址:https://www.wjcms.net/archives/laravel%E6%8A%A5%E9%94%99xxxlaravellogcouldnotbeopenedfailedtoopenstreampermissiondenied
laravel报错:The stream or file "/xxx/laravel.log" could not be opened: failed to open stream: Permission deniedlaravel
今天在搭建一个laravel项目时,忽然报上述错误,从字面意思上来看是没有权限,解决这个问题固然从权限考虑。 能够直接将文件夹权限设置为777,可是这样很是不安全,因此千万别这么作。 应该更改目录全部者。所以,设置当前用户,使你以全部者身份登陆,并以webserver用户(www,apache……)做为组登陆,这里运行下面两条命令:web
sudo chgrp -R www storage bootstrap/cache sudo chmod -R ug+rwx storage bootstrap/cache
便可成功解决上述问题。apache