当前位置: 首页 > 知识库问答 >
问题:

Laravel错误:未捕获的ReflectionException:Class App\Http\Kernel不存在

吉和同
2023-03-14

我不知道我对Laravel 5.3项目做了什么,但我有这个错误:

致命错误:未捕获的ReflectionException:Class App\Http\Kernel在C:\laragon\www\BookTime\vendor\laravel\framework\src\light\Container\Container中不存在。php:729堆栈跟踪:#0 C:\laragon\www\BookTime\vendor\laravel\framework\src\illighte\Container\Container。php(729):ReflectionClass-

OS:Windows10本地主机:Laragon PHP版本:5.6。4.

那是我的package.json

   {  "name": "laravel/laravel",
  "description": "The Laravel Framework.",
  "keywords": ["framework", "laravel"],
  "license": "MIT",
  "type": "project",
  "require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.3.*"
  },
  "require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~5.0",
    "symfony/css-selector": "3.1.*",
    "symfony/dom-crawler": "3.1.*"
  },
  "autoload": {
    "classmap": [
      "database"
    ],
    "psr-4": {
      "App\\": "app/"
    }
  },
  "autoload-dev": {
    "classmap": [
      "tests/TestCase.php"
    ]
  },
  "scripts": {
    "post-root-package-install": [
      "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
      "php artisan key:generate"
    ],
    "post-install-cmd": [
      "Illuminate\\Foundation\\ComposerScripts::postInstall",
      "php artisan optimize"
    ],
    "post-update-cmd": [
      "Illuminate\\Foundation\\ComposerScripts::postUpdate",
      "php artisan optimize"
    ]
  },
  "config": {
    "preferred-install": "dist",
    "sort-packages": true
  }
}

我在app.php的供应商

[

        /*
         * Laravel Framework Service Providers...
         */
        Collective\Html\HtmlServiceProvider::class,
        Barryvdh\Debugbar\ServiceProvider::class,
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Notifications\NotificationServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,

        /*
         * Package Service Providers...
         */
        Laravel\Tinker\TinkerServiceProvider::class,

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        // App\Providers\BroadcastServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

    ],

    /*
    |--------------------------------------------------------------------------
    | Class Aliases
    |--------------------------------------------------------------------------
    |
    | This array of class aliases will be registered when this application
    | is started. However, feel free to register as many as you wish as
    | the aliases are "lazy" loaded so they don't hinder performance.
    |
    */

    'aliases' => [
        'Form' => Collective\Html\FormFacade::class,
        'Debugbar' => Barryvdh\Debugbar\Facade::class,
        'Html' => Collective\Html\HtmlFacade::class,
        'App' => Illuminate\Support\Facades\App::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        'Blade' => Illuminate\Support\Facades\Blade::class,
        'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
        'Bus' => Illuminate\Support\Facades\Bus::class,
        'Cache' => Illuminate\Support\Facades\Cache::class,
        'Config' => Illuminate\Support\Facades\Config::class,
        'Cookie' => Illuminate\Support\Facades\Cookie::class,
        'Crypt' => Illuminate\Support\Facades\Crypt::class,
        'DB' => Illuminate\Support\Facades\DB::class,
        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
        'Event' => Illuminate\Support\Facades\Event::class,
        'File' => Illuminate\Support\Facades\File::class,
        'Gate' => Illuminate\Support\Facades\Gate::class,
        'Hash' => Illuminate\Support\Facades\Hash::class,
        'Lang' => Illuminate\Support\Facades\Lang::class,
        'Log' => Illuminate\Support\Facades\Log::class,
        'Mail' => Illuminate\Support\Facades\Mail::class,
        'Notification' => Illuminate\Support\Facades\Notification::class,
        'Password' => Illuminate\Support\Facades\Password::class,
        'Queue' => Illuminate\Support\Facades\Queue::class,
        'Redirect' => Illuminate\Support\Facades\Redirect::class,
        'Redis' => Illuminate\Support\Facades\Redis::class,
        'Request' => Illuminate\Support\Facades\Request::class,
        'Response' => Illuminate\Support\Facades\Response::class,
        'Route' => Illuminate\Support\Facades\Route::class,
        'Schema' => Illuminate\Support\Facades\Schema::class,
        'Session' => Illuminate\Support\Facades\Session::class,
        'Storage' => Illuminate\Support\Facades\Storage::class,
        'URL' => Illuminate\Support\Facades\URL::class,
        'Validator' => Illuminate\Support\Facades\Validator::class,
        'View' => Illuminate\Support\Facades\View::class,

    ],

请问我怎样才能解决这个问题?

共有1个答案

扶冠宇
2023-03-14

这通常通过以下方式解决:

php artisan config:clear
php artisan cache:clear
composer dump-autoload 
 类似资料:
  • 我试图去生活与laravel项目我开发了一年回到学校,我遇到了一些问题。在我的主机服务的服务器上上传整个项目后,我得到了这些错误在我的浏览器以及我的SSHshell。 致命错误:未捕获异常“ReflectionException”,在/home/clients/ffa41f94063541f86a0fe6602a73caa1/myforms/vendor/laravel/framework/src

  • 我收到了以下错误消息: 致命错误:未捕获错误:在F:\projects\websites\main\u website\app\Exceptions\Handler中找不到类“Auth”。php:65堆栈跟踪:#0 F:\projects\websites\main\u website\vendor\laravel\framework\src\illighted\Foundation\Http\K

  • 当我想在我的Laravel5.2项目中添加表单时,我在composer中遇到了一些错误。在那之后,我的整个项目出现了一个奇怪的错误: 致命错误:未捕获异常“ReflectionException”,在C:\xampp\htdocs\gifkadeh\vendor\laravel\framework\src\light\Container\Container中显示消息“Class App\Http\

  • 问题内容: 我目前正在尝试从github克隆我现有的项目。在克隆过程中运行之后,我收到以下错误: 我在Centos 7上运行Laravel 5.2 我看到过以下引用: 删除文件中的空格。 删除供应商目录并重新安装 删除composer.json中所需的某些软件包 我有: 将替换为,以避免任何自定义配置错误。 我已删除并重新克隆了仓库。 我已经使用Laravel附带的默认值来查看是否有所作为。 以上

  • 我正在使用以下代码向Laravel发布一些内容: (不相关代码省略) 当Laravel返回200时,这总体上是有效的。如果我从Laravel Axios返回401、422或其他东西,会在控制台中抛出一个错误,整个方法将停止运行。 我一直认为这是一种非常不利于开发人员的行为——我不明白吗?从后端API返回不同的状态代码应该有助于读取Vue中的响应,但Vue/Axios将每个非200响应视为致命错误。

  • 我现在必须学习通过fire base编写移动应用程序web服务。我点击了这个链接:https://firebase-php.readthedocs.io/en/stable/ 在我的核心网站中,我创建web服务文件夹,然后创建我的fire。php文件。这个文件代码在这里, 我得打电话给我的支持档案:https://github.com/kreait/firebase-php/ 但我还是得到了一个: