PHP CURL Error - curl: (56) Recv failure: Connection reset by peer

后端 未结 3 1047

basically, this error only occurs in CURL

curl: (56) Recv failure: Connection reset by peer

But when I visit it directly the link directly

3条回答
  •  北海茫月
    2020-12-17 19:51

    I resolved this issue by removing whitespace characters from the URL. In my situation, it was the proxy server that was erroring out, not the web server.

    In PHP:

         curl_setopt($ch, CURLOPT_URL, trim($url));
    

提交回复
热议问题