laravel踩坑记录
用这篇文章来记录laravel开发中遇到的问题
laravel报错,storage/logs文件没权限
报错内容:
UnexpectedValueException: There is no existing directory at "/Users/liuyunlong/www/laravel-shop/storage/logs" and it could not be created: Permission denied in file /var/www/html/laravel-shop/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 172
解决办法:
- 查看文件夹权限、所属者、所属组
- 查看是否有root用户的计划任务,也在使用此文件写日志
- 清除缓存(我使用这种方法之后就可以了)
php artisan route:clear php artisan config:clear php artisan cache:clear
- 修改配置文件,增加0664权限
参考链接:qastack.cn/programming/27674597/la...'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => 'debug', 'days' => 7, 'permission' => 0664, ],
本作品采用《CC 协议》,转载必须注明作者和本文链接