项目场景:
使用的场景是thinkphp6.0框架开发的HkCms开源内容管理系统,但出现的问题不局限于该系统,在使用composer命令安装其他库包会出现这个Class think\Config does not exist错误。
问题描述
在安装一款新库包时,该库包依赖thinphp,在安装成功后,当再次更新或安装其他插件时会报出以下错误:(Class think\Config does not exist)
PHP Fatal error: Uncaught ReflectionException: Class think\Config does not exist in D:\hkcms\vendor\topthink\framework\src\think\Container.php:375
Stack trace:
#0 D:\hkcms\vendor\topthink\framework\src\think\Container.php(375): ReflectionClass->__construct('think\\Config')
#1 D:\hkcms\vendor\topthink\framework\src\think\Container.php(251): think\Container->invokeClass('think\\Config', Array)
#2 D:\hkcms\vendor\topthink\framework\src\think\Container.php(130): think\Container->make('think\\Config')
#3 D:\hkcms\vendor\topthink\framework\src\think\Container.php(510): think\Container->get('config')
#4 D:\hkcms\vendor\topthink\framework\src\think\App.php(542): think\Container->__get('config