Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 开始使用nginx后出现FastCGI错误_Php_Yii_Nginx_Fastcgi - Fatal编程技术网

Php 开始使用nginx后出现FastCGI错误

Php 开始使用nginx后出现FastCGI错误,php,yii,nginx,fastcgi,Php,Yii,Nginx,Fastcgi,我刚开始在我的项目中使用服务器,并在其上安装了nginx作为web服务器。 在我的开发环境中,我使用apache,因为在Windows中,它的安装速度要快得多。我有一个基于Yii框架的PHP项目 由于我将源代码克隆到此服务器,因此收到此消息,但找不到任何解决方案: 2013/06/19 17:54:33 [error] 21842#0: *1 FastCGI sent in stderr: "PHP Parse error: syntax error, unexpected '[' in /p

我刚开始在我的项目中使用服务器,并在其上安装了nginx作为web服务器。 在我的开发环境中,我使用apache,因为在Windows中,它的安装速度要快得多。我有一个基于Yii框架的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"
该文件中的
行23
是一个正常的数组,没有额外的内容

$models = [];
由于此错误,我的站点返回状态代码为500

我的PHP配置未被更改


我不知道这是什么原因。如何解决此问题?

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


或者更新你的php版本。

你有>=PHP5.4版本吗?是的,我更新了,我只是需要重新启动…-。-无论如何谢谢你!