(目录)
问题描述
新项目报错
ThinkPHP: Class 'think\\facade\\Filesystem' not found
我保证我只改了数据库配置,其他代码都是原样拷贝过去的
查看 composer.lock 文件
{
"name": "topthink/framework",
"version": "v6.1.2",
}
找到他的2023年2月10日 发布的更新文档:ThinkPHP6.1.2版本发布——兼容PHP8.2
发现它删除了Filesystem
移除基础类中Filesystem申明属性
感觉和我的报错很相关了
解决方式
1、安装一个低版本的依赖
composer require topthink/framework=6.0.8
2、可以将版本锁定
修改前 composer.json
{
"require": {
"topthink/framework": "^6.0.8",
}
}
修改后 composer.json
{
"require": {
"topthink/framework": "6.0.8",
}
}