Laravel 5.0 file_put_contents错误

Just moved laravel project on hosting and it says:

production.ERROR: exception 'ErrorException' with message 'file_put_contents(/Users/max/sites/evocate.dev/storage/framework/sessions/7f7df88c52734c34a3f89286dc74d517d446c4fd): failed to open stream: No such file or directory' in /home/f/fb7929gh/evocate2/vendor/compiled.php:6440

Why it takes my local host path and where can I fix this?

You should make sure this directory exists and you have valid file permissions to this directory

Make a directory sessions with proper permission inside storage/framework You can make directory using terminal command in Ubuntu:

sudo mkdir storage/framework/sessions

Or you can create a directory directly inside project-root-folder/storage/framework/sessions

And also check **storage** and **bootstrap** have the full permission to write. 777 or 775

This issue is due to the Laravel Configuration Caching. You should typically run the

php artisan config:cache

command as part of your production deployment routine. I suggest you

  1. Remove the configuration cache file
  2. Flush the application cache
  3. Create a cache file for faster configuration loading

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

  1. php artisan config:clear
  2. php artisan cache:clear
  3. php artisan config:cache

Where you don't have access to the command line on your server, you can programmatically execute commands like this:

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

I hope this is helpful.