Please Help With cURL Error (7):

najib12

Registered
Dec 28, 2014
4
0
1
cPanel Access Level
Root Administrator
Hello All, I've problem with cURL,
Code:
cURL Error (7): Failed to connect to xxxxxx.io port 80: No route to host
May someone give me clue and advice to fix that error

Very Thank you
 

sneader

Well-Known Member
Aug 21, 2003
1,178
57
178
La Crosse, WI
cPanel Access Level
Root Administrator
Are you doing this from command line? If so, try to make sure you can resolve xxxxxx.io.

nslookup xxxxxx.io (or even ping xxxxxx.io)

Are you able to resolve the name to an IP?

- Scott
 

najib12

Registered
Dec 28, 2014
4
0
1
cPanel Access Level
Root Administrator
Are you doing this from command line? If so, try to make sure you can resolve xxxxxx.io.

nslookup xxxxxx.io (or even ping xxxxxx.io)

Are you able to resolve the name to an IP?

- Scott
Thank you for reply,
Here's reply:

Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)
- - - Updated - - -

And Why it work okay when I'm test call from another server
 

sneader

Well-Known Member
Aug 21, 2003
1,178
57
178
La Crosse, WI
cPanel Access Level
Root Administrator
If it works from another server, it's possible that there is a firewall problem, either on your server, or at the other server.

The ping test was mainly to see if you could do a proper DNS lookup. I am guessing you were able to do the DNS lookup, because your server then tried to ping whatever IP it resolved to. So, I do not think it's a DNS issue now.

Not sure if you have traceroute enabled on your server, but you could also try "traceroute xxxxxx.io" and see where it stops.

- Scott
 

najib12

Registered
Dec 28, 2014
4
0
1
cPanel Access Level
Root Administrator
Hello Scrott,
May you compare domain .io/test/t/check .php with project .domain .com/test/dlm2 .php?
Hope you can advice me...

Thank you
 
Last edited by a moderator:

sneader

Well-Known Member
Aug 21, 2003
1,178
57
178
La Crosse, WI
cPanel Access Level
Root Administrator
When you simply browse to: domain.io/test/t/check.php

It shows the script and in the script it says "Failed to connect to domain.io port 80: No route to host"

So, I don't think it's a cURL problem. The script itself doesn't work.

- Scott
 
Last edited by a moderator:

najib12

Registered
Dec 28, 2014
4
0
1
cPanel Access Level
Root Administrator
Hello Scott, how about domain .io/test/t/check .php

- - - Updated - - -

Sorry I meant domain .io/test/t/x .php
 
Last edited by a moderator:

sneader

Well-Known Member
Aug 21, 2003
1,178
57
178
La Crosse, WI
cPanel Access Level
Root Administrator
domain.io/test/t/x.php results in the same error (but it doesn't show the script)

"cURL Error (7): Failed to connect to domain.io port 80: No route to host"

Look, before you worry about using cURL, just try to browse to it using your web browser. If your web browser can't make it work, then your cURL command isn't going to work, either.

I don't need to test these in my browser... you can do this. :)

- Scott
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello :)

Yes, it seems like there is a connection/firewall issue that's preventing access attempts to the domain name in question. It's less of an issue with cURL and more of an issue with the connection itself.

Thank you.