【问题标题】:Laravel 5.7 upgrade, Uncaught ReflectionException: Class cache does not exist Container.php:779Laravel 5.7 升级,Uncaught ReflectionException: Class cache does not exist Container.php:779
【发布时间】:2019-04-29 00:43:23
【问题描述】:

将 Laravel 5.5 升级到 5.7 并运行 composer install 时,我看到了这个错误。 有没有其他人经历过类似的事情?

我还使用 forge 将 php 从 7.1 升级到 7.2,在将代码恢复到 laravel 5.5 后,使用 php 7.2 没有问题。

【问题讨论】:

标签: php laravel composer-php


【解决方案1】:

从 Laravel 5.6 到 5.7 的更改可能会导致此问题:

来自Upgrade Notes

一个新的数据目录已添加到 storage/framework/cache。您应该在自己的应用程序中创建此目录:

mkdir -p storage/framework/cache/data

然后,在新创建的数据目录中添加一个 .gitignore 文件:

cp storage/framework/cache/.gitignore storage/framework/cache/data/.gitignore

最后确保 storage/framework/cache/.gitignore 文件更新如下:

*
!data/
!.gitignore

从 Laravel 5.5 到 5.6 也发生了变化,但从看起来这似乎不太可能是原因。

【讨论】:

    猜你喜欢
    • 2016-09-03
    • 1970-01-01
    • 1970-01-01
    • 2022-11-09
    • 2023-01-30
    • 2020-10-03
    • 2023-02-23
    • 2017-06-07
    • 2015-09-14
    相关资源
    最近更新 更多