Laravel 显示“无法清除缓存.确保您拥有适当的权限" [英] Laravel showing "Failed to clear cache. Make sure you have the appropriate permissions"
问题描述
Laravel 向我显示用户 'homestead'@'localhost' 的访问被拒绝(使用密码:YES)".一种解决方案是清除缓存和存储的配置缓存,所有这些都使用以下三个命令:
Laravel was displaying to me "Access denied for user 'homestead'@'localhost' (using password: YES)". One solution for this was clearing the cache and the config cache stored, all this with these three commands:
php artisan cache:clear
php artisan config:clear
php artisan config:cache
在php artisan cache:clear
之后,终端说:
清除缓存失败.确保您拥有适当的权限.
(红色背景)
执行第二个和第三个代码(php artisan config:clear
和 php artisan config:cache
)效果很好!但是在输入第一行时它仍然给我错误.谁能解释为什么?
Doing the second and third code (php artisan config:clear
and php artisan config:cache
) works fine! But it still gives me the error when typing the first line. Can anyone explain why?
推荐答案
如果(storage/framework/cache/data
)下不存在data
目录,那么您将遇到此错误.
If the data
directory doesn't exist under (storage/framework/cache/data
), then you will have this error.
这个data
目录在全新安装时默认不存在.
This data
directory doesn't exist by default on a fresh/new installation.
在 (storage/framework/cache
) 手动创建 data
目录应该可以解决此问题.
Creating the data
directory manually at (storage/framework/cache
) should fix this issue.
这篇关于Laravel 显示“无法清除缓存.确保您拥有适当的权限"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!