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?
Asked
Active
Viewed 1,193 times
0

shyam
- 6,681
- 7
- 28
- 45
-
2It could be a firewall issue for example. – Pekka May 05 '10 at 08:33
-
in my server or the other..? and how do I find out? – shyam May 05 '10 at 08:55
-
what a ping $targethost is giving you? – May 05 '10 at 11:53
2 Answers
0
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
- 154
- 1
- 6
0
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
- 13,492
- 9
- 47
- 68
-
may I request you to have a look at http://stackoverflow.com/questions/11548965/file-get-contents-or-curl-way-nothing-works-in-internet-server-though-thos on the same issue – Istiaque Ahmed Jul 18 '12 at 20:23