Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kokurate's avatar

fwrite(): Write of 1905 bytes failed with errno=28 No space left on device

im using laravel 8

im uploaded the laravel project to the hosting

and i check the storage, the storage is not full

how to fix this problem

before i run this code, but still not work

	Route::get('/clear', function() {
		Artisan::call('cache:clear');
	   Artisan::call('config:cache');
	   Artisan::call('view:clear');
	  return "Cleared!";
		});
0 likes
3 replies
kokurate's avatar

@jlrdw i am trying to clear the log by the routes cause i can't use artisan. But it still don't work here's the code

Route::get('/clear', function() {
 Artisan::call('config:cache');
  Artisan::call('cache:clear');
  Artisan::call('config:clear');
  Artisan::call('view:clear');
  Artisan::call('route:clear');
  exec('rm -f ' . storage_path('logs/.log'));
  exec('rm -f ' . base_path('.log'));
  return "Cache is cleared";
  })->name('clear.cache');
sayasuhendra's avatar

just empty laravel.log

echo "" > storage/logs/laravel.log

for permanent solutions

Artisan::command('logs:clear', function() {
    
    exec('rm -f ' . storage_path('logs/*.log'));

    exec('rm -f ' . base_path('*.log'));
    
    $this->comment('Logs have been cleared!');
    
})->describe('Clear log files');

Please or to participate in this conversation.