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).
精彩评论