The stream or file "/data/www/laravel/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied


轉載至: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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM