Attila Naghi
Attila Naghi

Reputation: 2686

Weird syntax error after creating a new project in laravel 5

I created a new project: laravel new myprojectname and I am getting a blank page. First, I thought is about the permission so I gave the 777 to the storage folder, but I still had the blank page. Then I checked the logs and I saw this:

    production.ERROR: Parse error: syntax error, unexpected '?', expecting 
variable (T_VARIABLE) {"exception":"[object] (Symfony\\Component\\Debug
\\Exception\\FatalThrowableError(code: 0): Parse error: syntax error, 
unexpected '?', expecting variable (T_VARIABLE) at /opt/lampp/htdocs
/myprojectname/vendor/symfony/routing/Route.php:53)  .....

My php version is: 7.1.14 . Does anyone know why I get this ?

Thank you

Upvotes: 1

Views: 730

Answers (2)

Chin Leung
Chin Leung

Reputation: 14941

The ? at line 53 is the new nullable types introduced in PHP 7.1, and you are running PHP 7.0.9, hence the reason why you're getting the error.

Upvotes: 2

Kevin Pimentel
Kevin Pimentel

Reputation: 1916

Laravel just upgraded to 5.6 and it requires PHP 7.13.

Also, after you upgrade your PHP, make sure you upgrade PHPUnit ~7.0, fideloper/proxy ~4.0, and Symfony ~4.0.

Follow this link here for full upgrade details.

Upvotes: 0

Related Questions