Laravel 8 中不存在目标类 [blade.compiler]
安装 Composer 后,当我运行 php artisanserve 命令时,会显示此错误 - Illuminate\Contracts\Container\BindingResolutionException
目标类 [blade.compiler] 不存在 在我的 laravel 8 项目中
,该文件中出现错误,vendor\laravel\framework\src\Illuminate\Container\Container.php:879
代码:
try {
877▕ $reflector = new ReflectionClass($concrete);
878▕ } catch (ReflectionException $e) {
➜ 879▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
880▕ }
After composer installation, When I run php artisan serve command then this errors are shown-
Illuminate\Contracts\Container\BindingResolutionException
Target class [blade.compiler] does not exist
in my laravel 8 project
Error in that file, vendor\laravel\framework\src\Illuminate\Container\Container.php:879
Code :
try {
877▕ $reflector = new ReflectionClass($concrete);
878▕ } catch (ReflectionException $e) {
➜ 879▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
880▕ }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的 php 版本较旧,则可能会出现此问题,因此请尝试按照以下步骤将您的 php 版本升级到 php >= 8:
-1 从官方网站下载 php :
通过此链接:https://www.php.net/downloads
或对于 Windows,此链接:< a href="https://windows.php.net/download#php-8.1" rel="nofollow noreferrer">https://windows.php.net/download#php-8.1
-2 解压zip 并将文件夹放入你的php文件夹
-3更新你的系统环境变量
this problem can occur if you have old version of php, so try to upgrade your php version to php >= 8 following this :
-1 download php from the official website :
from this link : https://www.php.net/downloads
or for windows this link : https://windows.php.net/download#php-8.1
-2 extract the zip and put the folder in your php folder
-3 update your system environment variables