What is the curl error 52 "empty reply from server"?

Paul Sheldrake picture Paul Sheldrake · Dec 17, 2009 · Viewed 281.4k times · Source

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://www.example.com/backup.php

Lately I've been getting this error when the Cron runs:

curl: (52) Empty reply from server

If I go to the link directly in my browser the script runs fine and I get my little backup ZIP file.

Answer

Benoit Duffez picture Benoit Duffez · Mar 16, 2017

This can happen if curl is asked to do plain HTTP on a server that does HTTPS.

Example:

$ curl http://google.com:443
curl: (52) Empty reply from server