Open zhufeng opened 4 months ago
https://github.com/MoeNetwork/Tieba-Cloud-Sign/blob/09ca411da65a97808898e639466f85808c491153/templates/baiduid.php 看起来没有对外
wcurl
是不是mysql慢查询?
这个要如何排查呢,账号里面在只添加了一个百度账号的情况下,也会出现加载慢的问题。 甚至刚初始化环境,还没添加账号的情况下,也会出现这个问题。
但是奇怪的是,除了这个账号设置页面,其它页面的加载速度都正常。
在该文件里到处乱插
echo date(DATE_ATOM) . PHP_EOL;
然后
curl -v 您的tc/index.php?mod=baiduid
看卡哪行了
这页有个拉取登录二维码信息的对外请求,注释掉或者删掉试试,如果仍不行就不清楚了
这页有个拉取登录二维码信息的对外请求,注释掉或者删掉试试,如果仍不行就不清楚了
感谢,确实是这个问题。
把 get_login_qrcode()的所在这个140行注释掉,就正常了。
<?php $login_info = misc::get_login_qrcode(); ?>
可能是ipv6的问题。
[root@ ~]# curl -v https://passport.baidu.com/v2/api/getqrcode?lp=pc
* Trying [2409:8c00:6c21:109a:0:ff:b023:56f]:443...
* Connected to passport.baidu.com (2409:8c00:6c21:109a:0:ff:b023:56f) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* Recv failure: Connection reset by peer
* OpenSSL SSL_connect: Connection reset by peer in connection to passport.baidu.com:443
* Closing connection 0
curl: (35) Recv failure: Connection reset by peer
[root@ovm1 ~]# curl -4 -v https://passport.baidu.com/v2/api/getqrcode?lp=pc
* Trying 103.235.46.9:443...
* Connected to passport.baidu.com (103.235.46.9) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN: server accepted http/1.1
* Server certificate:
* subject: C=CN; ST=beijing; L=beijing; O=Beijing Baidu Netcom Science Technology Co., Ltd; CN=baidu.com
* start date: Jul 6 01:51:06 2023 GMT
* expire date: Aug 6 01:51:05 2024 GMT
* subjectAltName: host "passport.baidu.com" matched cert's "*.baidu.com"
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign RSA OV SSL CA 2018
* SSL certificate verify ok.
* using HTTP/1.1
> GET /v2/api/getqrcode?lp=pc HTTP/1.1
> Host: passport.baidu.com
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Expose-Headers: Trace-ID
< Connection: keep-alive
< Content-Length: 306
< Content-Type: application/json; charset=utf-8
< Date: Fri, 19 Apr 2024 02:13:23 GMT
< P3p: CP=" OTI DSP COR IVA OUR IND COM "
< Referrer-Policy: no-referrer-when-downgrade, strict-origin-when-cross-origin
< Server: BWS
< Set-Cookie: BAIDUID=*********
< Strict-Transport-Security: max-age=31536000
< Trace-Id:
< Tracecode: 34000073402849812490041910
<
* Connection #0 to host passport.baidu.com left intact
{"imgurl":"******"}
是否可以将wcurl()强制指定只解析v4地址,应该就能解决这个问题。
$get_qrcode = json_decode((new wcurl("https://passport.baidu.com/v2/api/getqrcode?lp=pc"))->get(), true);
https://stackoverflow.com/questions/25645634/force-ipv4-in-curl-in-php-application
- $get_qrcode = json_decode((new wcurl("https://passport.baidu.com/v2/api/getqrcode?lp=pc"))->get(), true);
+ $get_qrcode = json_decode((new wcurl("https://passport.baidu.com/v2/api/getqrcode?lp=pc"))->set(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4)->get(), true);
请问怎么看自己装的什么版本?怎么升级?我用的是docer compose,但是装上后显示的4.95什么情况?
问题描述
v5.0.1版本点击"百度账号设置"加载时间很长甚至直接504。
复现步骤
点击"百度账号设置"。
环境
备注
查看php-fpm的日志无异常,但nginx日志有504的报错。