php - file_put_contents(C :\storage\framework\views/27f511f5644086daa68b2cf835bf49f5148aba43. php): 无法打开流: 没有这样的文件或目录

标签 php laravel

所以我一直在我的实时服务器上收到此错误,但在我的本地主机上却没有,在我的本地主机上一切正常,但是当我在在线服务器上部署我的网站时,它一直给我这个错误

file_put_contents(C:\appname\storage\framework\views/27f511f5644086daa68b2cf835bf49f5148aba43.php): failed to open stream: No such file or directory

我尝试了php artisan config:cache但没有真正起作用

最佳答案

我认为您的问题是由于 Laravel Configuration Caching .我建议你

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

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

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

如果您无法访问服务器上的命令行,则可以 programmatically execute commands像这样:

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

我希望这对您有帮助。

关于php - file_put_contents(C :\storage\framework\views/27f511f5644086daa68b2cf835bf49f5148aba43. php): 无法打开流: 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49287758/

相关文章:

javascript - 来自 wordpress postmeta 表键的多个值

PHP - 重载属性的间接修改

php - 为什么 VirusTotal 会返回此错误?

php - 从2个表中选择多个数据,单击后按钮将禁用

php - Laravel 5 多个下载文件

php - Laravel PUT 没有收到参数/请求

php - 如何在laravel中生成类似facebook的实时通知系统

php - 在 Laravel 中运行 SQL 删除查询

php - 获取最近 7 天的用户积分

php - Laravel 4 中 server.php 文件的用途是什么?