Laravel 8 中不存在目标类 [blade.compiler]

发布于 2025-01-12 01:11:31 字数 537 浏览 4 评论 0原文

安装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怼怹恏 2025-01-19 01:11:31

如果您的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文