Installation error on Laravel 5.3

蹲街弑〆低调 提交于 2019-12-04 05:42:08

问题


I am trying to launch laravel which is locally hosted on my browser but it gives me the following error

Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /opt/lampp/htdocs/projects/larawiz/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 475

How can I correct this?


回答1:


Your problem is your version of PHP which I believe you may be using PHP 5.5.

Laravel 5.3 uses the splat operator which is only available in PHP version 5.6

The line you're referring to is : https://github.com/laravel/framework/blob/5.3/src/Illuminate/Foundation/helpers.php#L475

Which is outlined as part of 5.6 here: http://php.net/manual/en/migration56.new-features.php

Simply put, you either need to upgrade your version of PHP or move back to Lavavel 5.1 which I believe still supports PHP 5.5

Laravel 5.1 Requirements: https://laravel.com/docs/5.1/installation (PHP >= 5.5.9)

Laravel 5.3 Requirements: https://laravel.com/docs/5.3/installation (PHP >= 5.6.4)



来源:https://stackoverflow.com/questions/39486196/installation-error-on-laravel-5-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!