WWW-php, Cannot connect to destination host

When making many php calls via the [now legacy] WWW call, most of them get through but some will return the error “Cannot connect to destination host”. The next time the same exact call is made it will probably work, so not a mistake in the call/url.

Can someone with more backend knowledge tell me the most likely cause? Is the server on which the php resides refusing some requests for security reasons when many are made or is the actual php call returning this?

This message comes from your local protocol stack. Download myTraceRoute tool and test your route to that server. I bet you’ll see many failures along the data path.

2 Likes

You might also want to try a tool like Charles Proxy or Fiddler, both free.

1 Like

I’d suspect high packet loss between your device and the server. There’s various tools available for figuring out if that is the issue, and where the issue is coming from. I would use good old ping, wireshark, maybe tcpdump, etc.