My OS is ubuntu 16.04 and I am running Lumen 5.5.
When I try to run the app in the browser I get an error 500:
我在 /var/log/nginx 中收到该错误:
2017/10/09 06:51:26 [error] 1063#1063: *132 FastCGI sent in stderr:
"PHP message: PHP Fatal error: Uncaught UnexpectedValueException:
The stream or file "/home/ila/vhosts/dref_api.com/storage/logs/lumen.log"
could not be opened: failed to open stream: Permission denied in
home/ila/vhosts/dref_api.com/
vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107
Permission in storage/
is :![enter image description here](https://i.stack.imgur.com/gQEzo.png)
Permissions in vendor/ and all monolog/ sub files
are :![enter image description here](https://i.stack.imgur.com/pYg8j.png)
所以我觉得可以申请sudo chmod -R guo+w /vendor
但我不知道这是否有效,或者是否是一个好的做法。
您如何解决这个问题?
看起来存储文件夹没有写入日志文件的权限,所以
你可以跑
chmod -R o+w projectname/storage
chmod -R o+w projectname/bootstrap
如果你使用 nginx 那么你需要使用 nginx 用户权限,如下所示
sudo chown -R nginx:root storage
sudo chown -R nginx:root bootstrap
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)