laravel---清除缓存

在使用laravel框架的时候,在做网站迁移的时候,该框架的缓存非常严重,如何清理呢?

1、清除应用程序缓存

php artisan cache:clear

2、路由缓存

php artisan route:clear  // 关闭路由缓存
php artisan route:cache // 开启路由缓存 【开发环境,不要开启】

3、配置缓存

php artisan config:clear  // 清除配置缓存
php artisan config:cache // 开启配置缓存

4、清除视图缓存

php artisan view:clear

常见适用场景:

1、修改了 env 文件里的数据库配置,未生效,需要清除【配置缓存】

php artisan config:clear 

2、The version given was unknown or has no registered routes. 需要移除路由缓存文件

php artisan route:clear

打完收工!

posted @ 2022-07-17 18:14  帅到要去报警  阅读(2868)  评论(0编辑  收藏  举报