原文地址:https://www.wjcms.net/archives/laravel報錯xxxlaravellogcouldnotbeopenedfailedtoopenstreampermissiondenied
laravel報錯:The stream or file "/xxx/laravel.log" could not be opened: failed to open stream: Permission denied

今天在搭建一個laravel專案時,突然報上述錯誤,從字面意思上來看是沒有權限,解決這個問題當然從權限考慮,
可以直接將檔案夾權限設定為777,但是這樣非常不安全,所以千萬別這么做,
應該更改目錄所有者,因此,設定當前用戶,使你以所有者身份登錄,并以webserver用戶(www,apache……)作為組登錄,這里運行下面兩條命令:
sudo chgrp -R www storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
即可成功解決上述問題,
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/3672.html
標籤:PHP
上一篇:CI4框架應用一 - 環境搭建

