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

helen's avatar
Level 1

Php Artisan commands throw an error after composer update

Laravel Version: 5.4.21 PHP Version: 7.0.10

hello, I am new in Laravel. I would like to run locally a repository using laravel and wamp server. I have installed composer in windows and whenever I try to run either composer install or update I get the error which is displayed below. As a result I am not able to run php artisan commands. Do you have any idea what is the cause of this problem?

Description of the error when I run composer update:

Generating autoload files. Illuminate\Foundation\ComposerScripts::postupdate php artisan optimise [Symfony\COmponent\Debug\Exception\FatalErrorException] syntax error, unexpected '?' Script php artisan optimise handling the post-update-cmd event returned with error code 255.

Thank you for your time and patience.

0 likes
0 replies

Please or to participate in this conversation.