Sep.01

Laravel clear cache file manually if command not supported

When we migrate local file to online server. Laravel cache stored on local cached file also migrated. So this cache will look over the cache defined file but would not get local file location and gets an error like.

 

 

If server allow us to run command

the commad for clear cache is:

$php artisan config:cache

$php artisan config:clear

but we don’t access command line any type of server so that  we need remove file which are getting us problem to recreate cache file are located on.

Manual Remove Cache file(Server automatically generate new file with the location):

/bootstrap/cache/

there are

config.php

packages.php

services.php

 

 

so we need remove it manually then load site, the site are working properly from now.

 

+++++++++++++++++++++++++++

Add some clear config command with our route. then run the clear command but hitting url also be the fine solution to remove cache files.

+++++++++++++++++++++++++++

Route::get(‘/clear-cache’, function() {
Artisan::call(‘cache:clear’);
return”Cache is cleared”;
});

put these code into you route/web.php

and run from web url <your-domain>/clear-cache

it will works perfectly.

thanks

 

Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment