Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory

The best way to solve this problem is, go to directory laravel/bootstrap/cache and delete config.php file. or you can rename it as well like config.php.old And your problem will be fix.


You should typically run the php artisan config:cache command as part of your production deployment routine. As a solution to your problem, I suggest you recreate the cache file, for faster configuration loading.

To do this, run the following Artisan commands on your command line

  • php artisan cache:clear
  • php artisan config:cache

You can programmatically execute the command by adding the following to your routes:

Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    $exitCode = Artisan::call('config:cache');
    return 'DONE'; //Return anything
});

And then call the clear-cache route from your browser.


After some research I understand - I have very similar, but different root project locations and its cached in /bootstrap/cache. After cache clearing project started.