Laravel 5.0 file_put_contents 错误

Max*_*Max 2 php laravel laravel-5

刚刚将 laravel 项目移至托管,它说:

Production.ERROR:异常“ErrorException”,消息“file_put_contents(/Users/max/sites/evocate.dev/storage/framework/sessions/7f7df88c52734c34a3f89286dc74d517d446c4fd):无法打开流:/home/f/中没有这样的文件或目录” fb7929gh/evocate2/vendor/compiled.php:6440

为什么它需要我的本地主机路径以及在哪里可以解决这个问题?

Eli*_*noo 5

此问题是由于Laravel 配置缓存造成的。您通常应该运行

php artisan 配置:缓存

命令作为生产部署例程的一部分。我建议你

  1. 删除配置缓存文件
  2. 刷新应用程序缓存
  3. 创建缓存文件以加快配置加载速度

为此,请在命令行上运行以下 Artisan 命令

  1. php artisan 配置:清除
  2. php artisan 缓存:清除
  3. php artisan 配置:缓存

如果您无法访问服务器上的命令行,则可以通过编程方式执行如下命令:

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

我希望这是有帮助的。