0

How can I use a command like php artisan clear:cache, when deploying a laravel project in 000webhoso?

I tried to configured but still can't find out the solution

I need to clear the logs and cache, using migration

php artisan clear:cache

Error:

file_put_contents(C:\Users\FNRI\Desktop\final\storage\framework/sessions/Jutrm2SkTQTO8H0jB1wnGXm5y8HUd7siBBtjh8Jz): failed to open stream: No such file or directory

to get load my project

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Office use
  • 13
  • 3
  • Possible duplicate of [Laravel 5 show ErrorException file\_put\_contents failed to open stream: No such file or directory](https://stackoverflow.com/questions/46959985/laravel-5-show-errorexception-file-put-contents-failed-to-open-stream-no-such-f) – LF00 Sep 11 '19 at 06:36

2 Answers2

2

Go to directory bootstrap > cache > config.php Delete config.php file.

if you want to call php artisan clear:cache then you may create it route file as well

Route::get('/clear-cache', function() {
  Artisan::call('cache:clear');
            // return what you want
});
Route::get('/clear-view', function() {
  Artisan::call('view:clear');
            // return what you want
});
Route::get('/clear-config', function() {
  Artisan::call('config:clear');
            // return what you want
});

run as

  • domainname.com/clear-cache
  • domainname.com/clear-view
  • domainname.com/clear-config
Dilip Hirapara
  • 14,810
  • 3
  • 27
  • 49
1

That work at 100% add to routes/web in your Laravel project use: your domain/clear for solving any problems with cache

Route::get('/clear', function () {
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('view:clear');
Artisan::call('route:clear');
Artisan::call('clear-compiled');
Artisan::call('config:cache');

return '<h1>Cache facade value cleared </h1>';});
Ivan Dimov
  • 21
  • 1
  • 3