【Laravel7】The stream or file "storage/logs/laravel.log"could not be opened: failed to open stream: Permission denied
환경
오류
The stream or file "/work/backend/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
in /work/backend/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php (line 110)
in /work/backend/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php -> write (line 42)
in /work/backend/vendor/monolog/monolog/src/Monolog/Logger.php -> handle (line 323)
in /work/backend/vendor/monolog/monolog/src/Monolog/Logger.php -> addRecord (line 541)
in /work/backend/vendor/laravel/framework/src/Illuminate/Log/Logger.php -> error (line 174)
in /work/backend/vendor/laravel/framework/src/Illuminate/Log/Logger.php -> writeLog (line 87)
in /work/backend/vendor/laravel/framework/src/Illuminate/Log/LogManager.php -> error (line 547)
in /work/backend/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php -> error (line 122)
원인
storage
디렉토리에 쓰기 권한이 없기 때문입니다.대책
$ chmod -R 775 storage bootstrap/cache
storage
와 bootstrap/cache
의 2 개의 디렉토리는 기입 권한을 부여해 준다.관련 기사
Reference
이 문제에 관하여(【Laravel7】The stream or file "storage/logs/laravel.log"could not be opened: failed to open stream: Permission denied), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ucan-lab/items/54575fd939b9067d1cb6텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)