Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shaungbhone's avatar

php fatal error

I upgrade laravel 5.1 to 8, I got this error.

PHP Fatal error:  Declaration of Illuminate\Events\Dispatcher::listen($events, $listener = NULL) must be compatible with Illuminate\Contracts\Events\Dispatcher::listen($events, $listener, $priority = 0)
0 likes
7 replies
shaungbhone's avatar

it's still

PHP Fatal error:  Declaration of Illuminate\Events\Dispatcher::listen($events, $listener = NULL) must be compatible with Illuminate\Contracts\Events\Dispatcher::listen($events, $listener, $priority = 0) in /home/shaungbhone/Desktop/project-old/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 77
Snapey's avatar

make sure you clear the bootstrap/cache folder

1 like
Snapey's avatar

delete the contents of bootstrap/cache

1 like

Please or to participate in this conversation.