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

Sys Auditing's avatar

How to Upgrade Laravel Version from 5.2 to 6.20.44

I want to upgrade Laravel 5.2 to 6.20.44, and when running the following command : composer update Then i gote the following message error :

PHP Fatal error: Class Illuminate\Events\Dispatcher contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Contracts\Events\Dispatcher::fire, Illuminate\Contracts\Events\Dispatcher::firing) in /var/www/html/projectName/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 17 Script php artisan optimize handling the post-update-cmd event returned with error code 255

Any pointers on how to figure out my problem would be perfect.

Thank you

0 likes
2 replies
iamgeorge's avatar

Hi @sys auditing The error message you're seeing indicates that there's an inconsistency in the implementation of the Illuminate\Events\Dispatcher class, which is a core Laravel component. Starting from Laravel 5.3, the event dispatcher interface (Illuminate\Contracts\Events\Dispatcher) has changed, and it appears that your current version of Laravel (5.2) doesn't fully comply with this new interface.

Snapey's avatar
Snapey
Best Answer
Level 122

you cant upgrade from 5.2 to version 6 without following all the upgrade steps from 5.3, 5.4, 5.5, 5.6, 5.7, 5.8

And then, when you have done all that you would still be on a ridiculously old version.

Leave the 5.2 system alone and build a new project on PHP 8 then switch over.

1 like

Please or to participate in this conversation.