Home > OS >  i have this error when uploading my laravel api to 000webhost Fatal error: Uncaught ReflectionExcept
i have this error when uploading my laravel api to 000webhost Fatal error: Uncaught ReflectionExcept

Time:02-20

this is the full error

Warning: include(/storage/ssd5/948/18347948/public_html/vendor/composer/../vlucas/phpdotenv/src/Repository/RepositoryBuilder.php): Failed to open stream: No such file or directory in /storage/ssd5/948/18347948/public_html/vendor/composer/ClassLoader.php on line 571

Warning: include(): Failed opening '/storage/ssd5/948/18347948/public_html/vendor/composer/../vlucas/phpdotenv/src/Repository/RepositoryBuilder.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php:/usr/share/pear:/usr/share/php') in /storage/ssd5/948/18347948/public_html/vendor/composer/ClassLoader.php on line 571

Fatal error: Uncaught ReflectionException: Class "config" does not exist in /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:877 Stack trace: #0 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct() #1 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build() #2 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(851): Illuminate\Container\Container->resolve() #3 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Application->resolve() #4 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(836): Illuminate\Container\Container->make() #5 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1423): Illuminate\Foundation\Application->make() #6 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(469): Illuminate\Container\Container->offsetGet() #7 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(520): Illuminate\Log\LogManager->getDefaultDriver() #8 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(112): Illuminate\Log\LogManager->parseDriver() #9 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\Log\LogManager->driver() #10 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(252): Illuminate\Log\LogManager->error() #11 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): Illuminate\Foundation\Exceptions\Handler->report() #12 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\Foundation\Http\Kernel->reportException() #13 /storage/ssd5/948/18347948/public_html/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle() #14 {main} Next Illuminate\Contracts\Container\BindingResolutionException: Target class [config] does not exist. in /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:879 Stack trace: #0 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build() #1 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(851): Illuminate\Container\Container->resolve() #2 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Application->resolve() #3 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(836): Illuminate\Container\Container->make() #4 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1423): Illuminate\Foundation\Application->make() #5 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(469): Illuminate\Container\Container->offsetGet() #6 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(520): Illuminate\Log\LogManager->getDefaultDriver() #7 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(112): Illuminate\Log\LogManager->parseDriver() #8 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\Log\LogManager->driver() #9 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(252): Illuminate\Log\LogManager->error() #10 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): Illuminate\Foundation\Exceptions\Handler->report() #11 /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\Foundation\Http\Kernel->reportException() #12 /storage/ssd5/948/18347948/public_html/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle() #13 {main} thrown in /storage/ssd5/948/18347948/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 879

CodePudding user response:

It tries to reach some files on "public_html/vendor..." and vendor shouldn't be in the public_html under any circumstances.

  1. upload everything from public to public_html
  2. create a folder outside public_html (very important). Let's call it laravel_live.
  3. upload everything from your laravel repository to laravel_live folder.
  4. recreate symbolic links
  5. go to public_html/index.php and update the paths based on your folder structure. In this example, they should be DIR . '/../laravel_live/vendor/...

CodePudding user response:

Can you try "composer dump-autoload" ?

I think that will help you.

  • Related