今天把网站移到了NGINX服务器内进行测试,结果发现无法请求HTTPS的微信扫描支付
忙活了大半天,一直以为NGINX+APACHE的CGI有问题
因为安装的是ECSHOP,使用的PHP版本是5.2
实在无奈的情况下,开启了两台虚拟机,并且实现curl -i进行https请求,以下是返回的结果:
PHP5.3以上的版本: 返回了200
[root@qingxinzui ~]# curl -i https://www.baidu.com/
HTTP/1.1 200 OK
Server: bfe/1.0.8.5
Date: Fri, 26 Jun 2015 07:00:08 GMT
Content-Type: text/html
Content-Length: 227
Connection: keep-alive
Last-Modified: Thu, 09 Oct 2014 10:47:57 GMT
Set-Cookie: BD_NOT_HTTPS=1; path=/; Max-Age=300
Set-Cookie: BIDUPSID=F793F4C31DFC52C0060BBE10533263B7; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: PSTM=1435302008; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BDSVRTM=0; path=/
P3P: CP=” OTI DSP COR IVA OUR IND COM “
X-UA-Compatible: IE=Edge,chrome=1
Pragma: no-cache
Cache-control: no-cache
BDPAGETYPE: 1
BDQID: 0x855891be0001f8c6
BDUSERID: 0
Accept-Ranges: bytes
Set-Cookie: __bsi=2018999903383799926_00_200_N_N_80_0301_002F_N_N_N_0; expires=Fri, 26-Jun-15 07:00:13 GMT; domain=www.baidu.com; path=/
<html>
<head>
<script>
location.replace(location.href.replace(“https://”,”http://”));
</script>
</head>
<body>
<noscript><meta http-equiv=”refresh” content=”0;url=http://www.baidu.com/”></noscript>
</body>
</html>
再来看PHP5.2的版本:
[root@qingxinzui ~]# curl -i https://baidu.com
HTTP/1.1 302 Moved Temporarily
Server: bfe/1.0.8.5
Date: Fri, 26 Jun 2015 07:10:13 GMT
Content-Type: text/html
Content-Length: 160
Connection: keep-alive
Location: http://www.baidu.com/
<html>
<head><title>302 Found</title></head>
<body bgcolor=”white”>
<center><h1>302 Found</h1></center>
<hr><center>bfe/1.0.8.5</center>
</body>
</html>
[root@qingxinzui ~]#
直接给我返回302错误,害哥白辛苦了一个上午,居然就是版本太低估计不符合CURL的要求.使用的是CURL 7.19
看来想要完美的跑起ECSHOP,要么就是修改核心让ECSHOP支持5.3 要么就只能重置PHP环境,比如使用WAMP这种,或者重新安装过其他兼容版的CURL!
关于作者