什么是 curl 错误 52“来自服务器的空回复"? [英] What is the curl error 52 "empty reply from server"?

查看:24
本文介绍了什么是 curl 错误 52“来自服务器的空回复"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一台服务器上设置了一个 cron 作业,以在另一台服务器上托管的 PHP 中运行备份脚本.

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

我一直在使用的命令是

curl -sS http://www.example.com/backup.php

最近我在 Cron 运行时遇到了这个错误:

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

curl: (52) Empty reply from server

如果我直接在浏览器中转到链接,脚本运行良好,我会得到我的小备份 ZIP 文件.

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

推荐答案

如果要求 curl 在执行 HTTPS 的服务器上执行普通 HTTP,就会发生这种情况.

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

示例:

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

这篇关于什么是 curl 错误 52“来自服务器的空回复"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆