Laravel design error 5.7

Asked

Viewed 441 times

0

My project started presenting the error below when I run any command php artisan ...:

 $ php artisan --version 
   PHP Fatal error:  Uncaught
   ReflectionException: Class config does not exist in Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php:767
   Stack trace:
   #0 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(767): ReflectionClass->__construct('config')
   #1 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(646): Illuminate\Container\Container->build('config')
   #2 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(601): Illuminate\Container\Container->resolve('config', Arr ay)
   #3 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(735): Illuminate\Container\Container->make('config', Arr ay)
   #4 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(1210): Illuminate\Foundation\Application->make('config')
   #5 Y:\public\book\projeto\vendor\laravel\framework in Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 767

  Fatal error: Uncaught ReflectionException: Class config does not exist in Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php:767
   Stack trace:
   #0 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(767): ReflectionClass->__construct('config')
   #1 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(646): Illuminate\Container\Container->build('config')
   #2 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(601): Illuminate\Container\Container->resolve('config', Arr ay)
   #3 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(735): Illuminate\Container\Container->make('config', Arr ay)
   #4 Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php(1210): Illuminate\Foundation\Application->make('config')
   #5 Y:\public\book\projeto\vendor\laravel\framework in Y:\public\book\projeto\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 767

I can execute no command, but what is ready works, someone can give a strength?

  • tries to run this command

  • Returned with the same errors and message below: Script @php Artisan package:Discover --ansi Handling the post-autoload-dump Event returned with error code 255

  • worst is that all the projects on the server present this error, so it is something related to even I believe

  • looks in the directory for the vendor folder, see if it exists! and tests this command php Artisan clear-Compiled, if not correct for a check in your . env and see if everything is correct and no special characters!

  • if it doesn’t work out, test that too Composer update && Composer dump-autoload and then check on that link https://cursos.alura.com.br/forum/topico-erro-ao-executar-php-artisan-serve-37460 Good luck!

1 answer

1

I managed to solve it, in case someone has this kind of problem, I always used php 7.2, then another programmer came and installed php 7.0 to run another project, when I returned php 7.2 on my machine everything was normal again.

  • Yes the Laravel 5.7 has to have the PHP >= 7.1.3 I was just about to say that to you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.