views:

249

answers:

2

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 apparently 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?

A: 

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.

geek1983
A: 

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.

mattbasta