Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony parse error in output.php when creating project in laravel

Installed laravel 5.6 Have PHP 7.0 installed as well. When I try

laravel new sample-project 

it creates the required files and dependencies but bails with an error below:

PHP Parse error:  syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/johndoe/laravel/sample-project/vendor/symfony/console/Output/Output.php on line 40

Have a feeling this might be due to issues with the symfony file but not sure how to go about getting the right version or making a change in Output.php

Trying any other command such as

php artisan list

results in the same error

Composer relevant section denoting laravel 5.6 / php 7.1.3

"require": {
    "php": "^7.1.3",
    "fideloper/proxy": "~4.0",
    "laravel/framework": "5.6.*",
    "laravel/tinker": "~1.0"
},

Any help would be appreciated.

EDIT

Based on the answer I had to create a project with laravel version 5.5 which means I had to use

composer create-project laravel/laravel sample-project "5.5.*"

That worked.

like image 561
user275157 Avatar asked Jan 29 '23 16:01

user275157


1 Answers

Laravel 5.6 requires PHP > 7.1.3

you will need to make sure your server meets the following requirements:

PHP >= 7.1.3
like image 187
Sapnesh Naik Avatar answered Jan 31 '23 09:01

Sapnesh Naik