Laravel 5.3上的安装错误 [英] Installation error on Laravel 5.3

查看:111
本文介绍了Laravel 5.3上的安装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动在我的浏览器本地托管的laravel,但它给了我以下错误

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

解析错误:语法错误,意外的.",预期为&"或第475行上的/opt/lampp/htdocs/projects/larawiz/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php中的变量(T_VARIABLE)

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

我该如何纠正?

推荐答案

您的问题是您的PHP版本,我相信您可能正在使用PHP 5.5.

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

Laravel 5.3使用splat运算符,该运算符仅在PHP 5.6版中可用

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

您所指的行是: https://github.com/laravel/framework/blob/5.3/src/Illuminate/Foundation/helpers.php#L475

此处在5.6中概述了哪些内容: http://php.net/manual/en/migration56.new-features.php

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

简而言之,您要么需要升级PHP版本,要么移回Lavavel 5.1,我相信它仍然支持PHP 5.5

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要求: https://laravel.com/docs/5.1/installation ( PHP> = 5.5.9)

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

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

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

这篇关于Laravel 5.3上的安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆