Laravel Error 'ReflectionException' - 'App of class \ Http \ Kernel does not exist'

I tried to start living with the laravel project, which I developed a year ago at school, and I ran into some problems. After downloading the entire project on my hosting services server, I received these errors in my browser, as well as in my SSH shell.

Fatal error: exception "ReflectionException" with the message "App class" \ Http \ Kernel does not exist "in / home / clients / ffa41f94063541f86a0fe6602a73caa1 / myforms / vendor / laravel / framework / src / Illuminate / Container / Container.php: +779 Track stack: # 0 / home / clients / ffa41f94063541f86a0fe6602a73caa1 / myforms / vendor / laravel / framework / src / Illuminate / Container / Container.php (779): ReflectionClass → __ construct ('App \ Http \ Kernel') # 1 / home / clients / ffa41f94063541f86a0fe6602a73caa1 / myforms / vendor / laravel / framework / src / Illuminate / Container / Container.php (659): Illuminate \ Container \ Container-> build ('App \ Http \ Kernel', Array) # 2 / home / clients /ffa41f94063541f86a0fe6602a73caa1/myforms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(644): Illuminate \ Container \ Container-> make ('App \ Http \ Kernel', Array) # 3 / home clients ffa41f94063541f86a0fe6602a73caa1 / myforms / vendor / laravel /framework/src/Illuminate/Container/Container.php(229): Illuminate \ Foundation \ Application-> make ('App \ Http \ Kernel', Array) # 4 / home / clients / ffa41f94063 in / home / clients / ffa 41f94063541f86a0fe6602a73caa1 / myforms / vendor / laravel / framework / src / Illuminate / Container / Container.php on line 779

I think this may be due to my namespace configuration, because I haven't figured it out yet.

Here is my composer.json file:

{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "laravel/framework": "5.0.*", "illuminate/html": "5.*", "barryvdh/laravel-dompdf": "0.5.*", "guzzlehttp/guzzle": "~4.0" }, "require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, "autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "myforms/app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-create-project-cmd": [ "php -r \"copy('.env.example', '.env');\"", "php artisan key:generate" ] }, "config": { "preferred-install": "dist" } } 

What I have already done:

  • Uninstall / sell and make a new installation using composer install
  • composer dump-autoload
  • composer update btw, I get an error when I insert composer update

Please let me know if I should post another file that may be useful.

Thanks in advance for your help.

+5
source share
1 answer

In the composer.json variant:

  "psr-4": { "App\\": "myforms/app/" } 

in

  "psr-4": { "App\\": "app/" } 

On the server in the source directory, run composer update , then composer dump-autoload

Laravel's PSR-4 looks for namespaces relative to the project root

+5
source

All Articles