如何清除服务器上的路由缓存:Laravel 5.2.37 [英] How to clear Route Caching on server: Laravel 5.2.37

查看:259
本文介绍了如何清除服务器上的路由缓存:Laravel 5.2.37的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与本地主机上的路由缓存有关

This is regarding route cache on localhost

我的route.php文件中有2条路由.两者都工作正常.没问题.我正在学习route:clear和route:cache,并在下面发现了一个小问题.

I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.

如果我在route.php文件中注释了一条路由,然后在命令下运行

if I comment any one route in my route.php file and then run below command

php artisan route:cache

这将使路由保持禁用状态,因为路由列表现在处于高速缓存中.现在,转到route.php文件,尝试删除注释的路由,然后尝试运行该启用的url.仍然会显示404,因为我需要使用以下命令删除缓存

This will keep the route disabled because the route list is in cache now. Now, go to route.php file and try to remove commented route and then try to run that enabled url. still it will show 404 because I need to remove cache by using below command

php artisan route:clear

到目前为止,所有内容都可以在localhost中理解.没问题.

So far everything is understood in localhost. No problem in that.

问题:如何删除服务器上的路由缓存?

Question : How can I remove the route cache on server?

推荐答案

如果要删除服务器上的路由缓存,请删除此文件:

If you want to remove the routes cache on your server, remove this file:

bootstrap/cache/routes.php

如果要更新它,只需运行php artisan route:cache并将bootstrap/cache/routes.php上载到服务器.

And if you want to update it just run php artisan route:cache and upload the bootstrap/cache/routes.php to your server.

这篇关于如何清除服务器上的路由缓存:Laravel 5.2.37的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆