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

后端 未结 20 2420
北海茫月
北海茫月 2020-12-04 17:26

I have a project on Laravel 5 and I work with it at the office and at home too. It works fine, but recently at home it stopped working. Laravel show me two ErrorException

20条回答
  •  悲哀的现实
    2020-12-04 17:53

    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.

    I hope this is helpful.

提交回复
热议问题