What is the curl error 52 “empty reply from server”?

前端 未结 15 2646
忘了有多久
忘了有多久 2020-11-29 02:22

I have a cron job setup on one server to run a backup script in PHP that is hosted on another server.

The command I\'ve been using is

curl -sS http://w         


        
15条回答
  •  有刺的猬
    2020-11-29 03:00

    Try this -> Instead of going through cURL, try pinging the site you’re trying to reach with Telnet. The response that your connection attempt returns will be exactly what cURL sees when it tries to connect (but which it unhelpfully obfuscates from you). Now, depending on what what you see here, you might draw one of several conclusions:

    You’re attempting to connect to a website that’s a name-based virtual host, meaning it cannot be reached via IP address. Something’s gone wrong with the hostname—you may have mistyped something. Note that using GET instead of POST for parameters will give you a more concrete answer.

    The issue may also be tied to the 100-continue header. Try running curl_getinfo($ch, CURLINFO_HTTP_CODE), and check the result.

提交回复
热议问题