tags:

views:

304

answers:

1

Hi guys,

I had a basic Curl script which basically executed a script on remote server. I was working fine 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!!?

I did google a bit, but didn't got any good explanation.

Thanks, Tanmay

A: 

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

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

Usually the exact error message is in there somewhere.

Wrikken
@Wrikken : I am already doing your suggestion, and it gives me the error which I mentioned above. Error code : 56. And error printed out in file is : Failure when receiving data from the peer. Thanks for your suggestion though.
jtanmay
Sounds like a TCP problem. What happens if you increase the timeout> And are you sending more headers the just a GET / POST? (i.e. host etc.)? If not, what happens if you add them, and vice-versa?
Wrikken
@Wrikken: Thanks for your suggestion, I had to take up the matter with the remote host administrator, and found out that he has changed the server machine!!! And he forgot to do some IP config settings in the server. Thanks for your help.
jtanmay