卷曲超时 - 错误 28 - VPS 到另一个 VPS 连接

时间:2021-06-15 16:00:51

标签: curl centos php-curl

接下来是情况,我订购了两个 VPS 服务器,第一个服务器包含应该向另一个 VPS 发送 API 请求的网站。

我遇到下一个 cURL 错误:

curl: (28) Failed to connect to my.second.vps.ip port 2222: Connection timed out

两台服务器上的防火墙都关闭了,所以防火墙不是问题,当从 wamp64 (localhost) 连接到我的第二个 VPS (my.second.vps.ip) 时,cURL 连接成功,但从第一个 VPS 就不是这样了.

我在两台服务器上都运行 CentOS 8。

同时 ping 第二个 VPS 似乎也不起作用:

$ ping my.second.vps.ip
PING my.second.vps.ip (my.second.vps.ip) 56(84) bytes of data.

--- my.second.vps.ip ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 8186ms

从我的 Windows PC ping my.second.vps.ip 工作正常,与 cURL 相同。

C:\Users\DELL>ping my.second.vps.ip

Pinging my.second.vps.ip with 32 bytes of data:
Reply from my.second.vps.ip: bytes=32 time=44ms TTL=56
Reply from my.second.vps.ip: bytes=32 time=43ms TTL=56
Reply from my.second.vps.ip: bytes=32 time=43ms TTL=56
Reply from my.second.vps.ip: bytes=32 time=130ms TTL=56

Ping statistics for my.second.vps.ip:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 43ms, Maximum = 130ms, Average = 65ms

有什么解决办法吗?提前致谢。

0 个答案:

没有答案
相关问题