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

前端 未结 15 2649
忘了有多久
忘了有多久 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:04

    In my case (curl 7.47.0), it is because I set the header content-length on curl command manually with a value which is calculated by postman (I used postman to generate curl command parameters and copy them to shell). After I delete header content-length, it works normally.

    0 讨论(0)
  • 2020-11-29 03:09

    In my case this was caused by a PHP APC problem. First place to look would be the Apache error logs (if you are using Apache).

    Hope this helps somebody.

    0 讨论(0)
  • 2020-11-29 03:12

    It happens when you are trying to access secure Website like Https.

    I hope you missed 's'

    Try Changing URL to curl -sS -u "username:password" https://www.example.com/backup.php

    0 讨论(0)
  • 2020-11-29 03:13

    I've had this problem before. Figured out I had another application using the same port (3000).

    Easy way to find this out:

    In the terminal, type netstat -a -p TCP -n | grep 3000 (substitute the port you're using for the '3000'). If there is more than one listening, something else is already occupying that port. You should stop that process or change the port for your new process.

    0 讨论(0)
  • 2020-11-29 03:16

    In case of SSL connections this may be caused by issue in older versions of nginx server that segfault during curl and Safari requests. This bug was fixed around version 1.10 of nginx but there is still a lot of older versions of nginx on the internet.

    For nginx admins: adding ssl_session_cache shared:SSL:1m; to http block should solve the problem.

    I'm aware that OP was asking for non-SSL case but since this is the top page in goole for "empty reply from server" issue, I'm leaving the SSL answer here as I was one of many that was banging my head against the wall with this issue.

    0 讨论(0)
  • 2020-11-29 03:16

    In my case I was using uwsgi, added the property http-timeout for more then 60 seconds but it was not working because of some extra space and config file was not getting loaded properly.

    0 讨论(0)
提交回复
热议问题