Laravel error - Class setEventDispatcher does not exist

后端 未结 7 1364
猫巷女王i
猫巷女王i 2021-01-18 07:51

Short version

I\'m getting this error, when I run php artisan serve and visit my home page:

ReflectionException (-1)
Class setEventDis         


        
相关标签:
7条回答
  • 2021-01-18 08:18

    I am facing the same issue in mac book pro. My system configuration is PHP 7.3, MySQl and I use SQL Pro. I have implemented all the above methods but nothing gets worked. The issue is still a mystery for me but for temporary I have solved this issue using artisan command as bellow.

    php artisan serve

    Its Allow me to run the project on http://localhost:8000 Hope this can help to solve this issue.

    0 讨论(0)
  • 2021-01-18 08:22

    So this is what usually fixes it for me

    1. Reinstall composer dependencies by removing vendor folder and composer.lock. Then run composer clear-cache and then composer install (this is usually the problem)

    2. Check that all service providers are imported correctly in app.php under directory config

    3. Make sure that your service providers are not importing something that does not exist, for example if you register a service provider in production but is only installed as dev:

      if (env('APP_DEBUG')) { $app->register(Barryvdh\Debugbar\LumenServiceProvider::class); }

    0 讨论(0)
  • 2021-01-18 08:24

    The fix for me was to update PHP to 7.3.3 and then restart valet. Apparently this was a bug with php 7.3

    https://github.com/laravel/framework/issues/27052

    Hope this helps

    0 讨论(0)
  • 2021-01-18 08:26

    I got some idea... I've just run into this problem after reconfiguring my apache virtual host ports, so I restarted apache/httpd again, and the problem went away. Might it be related with the server environment?

    0 讨论(0)
  • 2021-01-18 08:26

    Try to restart PHP. When I reboot my Mac, then this happens. After restarting PHP everything starts to work.

    sudo brew services restart nginx
    
    0 讨论(0)
  • 2021-01-18 08:36

    If you use valet, I solved it running

    valet restart and all works fine.

    cheers!

    0 讨论(0)
提交回复
热议问题