轉載至:https://cloud.tencent.com/developer/ask/170024
Linux 部署 Laravel項目,運行報錯
The stream or file "/data/www/laravel/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
網上找到如下解決方法,測試有效
Web服務器用戶和組依賴於你的Web服務器和操作系統。找出你的Web服務器用戶和組使用以下命令的內容。對於nginx使用:
ps aux|grep nginx|grep -v grep
用於apache:
ps aux | egrep '(apache|httpd)'
cd /data/www/laravel/ 目錄執行
chown -R $USER(用戶):web用戶組 storage