FastCGI错误,开始使用nginx后


FastCGI error, after started using nginx

我刚开始为我的项目使用服务器,我在上面安装了nginx作为web服务器。在我的开发环境中,我使用apache,因为在Windows中安装它要快得多。我有一个基于ii-框架的PHP项目。

由于我将源代码克隆到此服务器,所以我得到了此消息,并且我找不到解决它的任何解决方案:

2013/06/19 17:54:33 [error] 21842#0: *1 FastCGI sent in stderr: "PHP Parse error:  syntax error, unexpected '[' in /path/to/file.php on line 23" while reading response header from upstream, client: 85.XXX.YYY.ZZZ, server: example.dk, request: "GET /product/list HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "example.dk"

该文件中的line 23是一个普通的数组初始化,没有其他内容。

$models = [];

由于这个错误,我的站点返回状态码500。

我的PHP配置是不变的。

我想不出是什么原因引起的。我应该如何解决这个问题?

$models = [];替换为$models = array();的短数组语法仅在php>= 5.4中支持。