开发者

php Curl error: Failure when receiving data from the peer

开发者 https://www.devze.com 2023-01-04 01:30 出处:网络
I had a basic Curl script which basically executed a script on remote server. I was working f开发者_开发知识库ine from around 6 months.

I had a basic Curl script which basically executed a script on remote server. I was working f开发者_开发知识库ine from around 6 months.

Yesterday it stopped working, and was giving back following error.

Curl error: Failure when receiving data from the peer

Would like to know if anyone knows on which condition the curl would returned such error?


When dealing with problem with curl, run it again with:

curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR,  fopen('php://output', 'w'));

Usually the exact error message is in there somewhere.

Fixed: CURLOPT_STDERR indeed needs a stream resource as @Lübnah states in the comments, and @Roman tried to edit in (although earlier reviewers denied the edit, I've now included it in the answer).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号