Run this to check which php version composer picks up
composer -vvv about
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Not sure what I've done.
Ran composer install --optimize-autoloader --no-dev
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 0 updates, 41 removals
...
...
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
In web.php line 21:
syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Ran php -v
PHP 8.0.12 (cli) (built: Oct 28 2021 15:25:09) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
mydomain.com [~/public_html/sitename]#
It's catching on the php8 syntax in my web.php first route of the file...
/*
|--------------------------------------------------------------------------
| General Page Routes
|--------------------------------------------------------------------------
*/
Route::get('/', fn () => view('home')) // <-- this line
->name('home');
@webrobert you can try
php /path/to/composer install --optimize-autoloader --no-dev
Please or to participate in this conversation.