solaro
V2EX  ›  PHP

如何解决 PHP 中的异步 curl 请求失败问题。

  •  
  •   solaro · Oct 12, 2019 · 5441 views
    This topic created in 2579 days ago, the information mentioned may be changed or developed.

    1.使用 laravel,异步(队列)去请求 curl,curl 超时为 3 秒。 2.请求量不大( 1 分钟 10 个),但是经常出现 curl 请求失败的问题,服务器都在海外,互相之间的通信延迟仅有不到 100ms 3.换 guzzle 会比 curl 好?我看了说明 guzzle 默认使用的也是 curl,只不过是封装了一层。

    7 replies  •  2019-10-13 11:47:21 +08:00
    justseemore
    justseemore
    Oct 12, 2019
    1
    挂代理吧,无解
    newtype0092
    newtype0092
    Oct 12, 2019
    2
    为什么怀疑是 curl 的问题?你可以按这个频率请求百度试试
    U7Q5tLAex2FI0o0g
    U7Q5tLAex2FI0o0g
    Oct 12, 2019
    3
    既然都问了,你不能把报错信息发出来么
    bzj
    bzj
    Oct 12, 2019
    4
    目测是自己网络不行,你用浏览器能打开吗?
    agdhole
    agdhole
    Oct 12, 2019
    5
    看看 log
    CMNET
    CMNET
    Oct 12, 2019 via Android
    6
    clientip
    hprjunxxx
    hprjunxxx
    Oct 13, 2019
    7
    加个重试机制?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5363 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 119ms · UTC 03:00 · PVG 11:00 · LAX 19:00 · JFK 22:00
    ♥ Do have faith in what you're doing.