我正在尝试在ubuntu 16.04上新安装的laravel 5.6上运行composer dump-autoload。该命令适用于我的mac,但不适用于服务器。 我明白了:
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Parse error: syntax error, unexpected '?', expecting variable
(T_VARIABLE) in ../vendor/symfony/console/Output/Output.php on line 40
PHP Parse error: syntax error, unexpected '?', expecting variable
(T_VARIABLE) in ../vendor/symfony/console/Output/Output.php on line 40
Script @php artisan package:discover handling the post-autoload-dump
event returned with error code 255
任何人都知道我做错了什么?
服务器上的php -v返回:
PHP 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 6 2018
11:18:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.3-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c)
1999-2018, by Zend Technologies
我的symfony / console已版本化 - v4.0.6
运行composer update在我的旧版laravel(5.4)的服务器的其他目录中工作,我有symfony / console v3.3.0