solaro
V2EX  ›  PHP

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

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