wnmp环境安装yii框架报504错误的解决办法

今天在wnmp环境下安装yii框架的时候报了504的错误,然后查看nginx的错误日志报了以下的错误:

2017/03/19 19:47:03 [error] 12460#12392: *8 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: www.yii.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.yii.com"


接着查看php的错误日志,显示以下错误:

2017/03/19 19:36:30 [error] 12460#12392: *3 FastCGI sent in stderr: "PHP Notice:  Use of undefined constant INTL_ICU_VERSION - assumed 'INTL_ICU_VERSION' in D:\wnmp\html\yii2\vendor\yiisoft\yii2\requirements\requirements.php on line 61
PHP Notice:  Use of undefined constant INTL_ICU_VERSION - assumed 'INTL_ICU_VERSION' in D:\wnmp\html\yii2\vendor\yiisoft\yii2\requirements\requirements.php on line 67" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /yii2/requirements.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "localhost"


基本可以确定是fastcgi没开启导致的问题了。

那么这个fastcgi是干什么吃的呢? 原来是是个cgi(Common GatewayInterface)通用网关接口,它用来连接nginx和PHP的,和php-cgi.exe有关系。 所以很明显,我以上的动作并没有搞过php-cgi.exe,所以导致没人CGI去处理nginx的连接吧,所以一直才会TIMEOUT。。。 用以下语句:
D:\wnmp\php>php-cgi.exe -b 127.0.0.1:9000 -c D:/wnmp/php/php.ini
启动了php-cgi,然后重新启动nginx,最后打开yii的页面,就没有出现504的错误了,问题解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值