Laravel显示“无法清除缓存。请确保您具备适当的权限”

12 浏览
0 Comments

Laravel显示“无法清除缓存。请确保您具备适当的权限”

Laravel 给我显示了 \"Access denied for user \'homestead\'@\'localhost\' (using password: YES)\"。解决之道是清除缓存和 config 缓存,这需要使用以下三条命令:

php artisan cache:clear
php artisan config:clear
php artisan config:cache

在使用 php artisan cache:clear 后,终端会显示:

Failed to clear cache. Make sure you have the appropriate permissions.(带红色背景)

执行第二和第三行代码 (php artisan config:clearphp artisan config:cache) 都没问题! 但是输入第一行仍然会给我报错。有没有人能解释一下为什么?

admin 更改状态以发布 2023年5月23日
0
0 Comments

请尝试删除 bootstrap 文件夹下的这些缓存文件:

/bootstrap/cache/packages.php
/bootstrap/cache/services.php
/bootstrap/cache/config.php

然后运行 php artisan cache:clear

0
0 Comments

如果在(storage/framework/cache/data)下不存在data目录,则会出现此错误。\n新安装默认情况下不会存在该data目录。\n在(storage/framework/cache)下手动创建data目录可以解决这个问题。

0