標籤

ASP.NET MVC (29) Visual C# (15) JQuery (10) Plugins (8) JQuery Plugins (6) JavaScript (6) MySQL (5) CSS (4) LinQ (4) Mac OS (4) CentOS (3) Design Pattern (3) Entity Framework (3) IIS (3) Python (3) Windows (3) php (3) Docker (2) LAMP (2) SQL Server (2) WCF (2) .NET (1) .NET Core (1) AWS (1) Browser (1) GIS (1) IE (1) Internet Security (1) Linux (1) Platform (1) React (1) SEO (1) Testing (1) VMware (1) Windows 7 (1) cookie (1) curl (1) laravel (1) phpBB (1) session (1) 中古屋 (1) 透天 (1) 閒言閒語 (1) 面試 (1) 鳥松 (1)

2016年11月22日 星期二

[PHP] Laravel syntax error, unexpected '[' in guzzlehttp/guzzle/src/functions.php on line ...


這幾天重新安裝Laravel時, 發現apache出現PHP錯誤

syntax error, unexpected '[' in guzzlehttp/guzzle/src/functions.php on line



看訊息一開始以為是guzzle http client有錯誤,

查詢後發現原來[]語法代表陣列是PHP5.4之後的版本才支援,

如果是使用PHP5.3或更早版本則會出現語法錯誤(Parse error).

解決方式是將PHP升級至5.4或者更新版本即可.


Reference:

1. i have error in laravel on function /vendor/guzzlehttp/psr7/src/functions.php on line 77 [duplicate]