开发者

Problem getting response from server using cURL, file_get_contents, etc

I am trying to get the response from a server, which is now not giving any response. I tried file_get_contents(), cURL, and tried getting the headers, but apparen开发者_如何学Pythontly the server is not responding. There are no headers returned or any response of any kind. Also, this happens when I try from my web server - it works fine in my local machine.

The server I'm calling is an sms server, to use which they've given a url. The problem is only with this particular server. I get response while trying Google. So may be it's caused by the called server.

What I wanna know is what could be (or how to find out) the reasons...

Any advices?

Using curl, curl_error($ch) returned: couldn't connect to host

Why does this happen? I mean what are the possible situations when curl_errno is 7?


It's because it fail to connect to the host or proxy. Can you ping this server? If so, can you give us the link? We could try it and tell you what's wrong.


If you're on a shared host, there's a great likelihood that they disallow cURL and remote file_get_contents. If you can't connect at all and you can connect on your own machine, then this may very well be the issue.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜