PHP cURL error 6 connecting to Cloudflare Workers

Website URL

https://varsports.gt.tc

Error Message

The endpoint https://varsports-api.aptulaff.workers.dev/health works in my browser and returns {“service”:“VAR SPORTS API”,“version”:1}.

Please check DNS resolution and outbound access from hosting account if0_43115733.

Other Information

The endpoint https://varsports-api.aptulaff.workers.dev/health works in my browser and returns {“service”:“VAR SPORTS API”,“version”:1}.

However, PHP cURL on my InfinityFree website fails with error 6 (Could not resolve host), HTTP 0.

Please check DNS resolution and outbound access from hosting account if0_43115733.

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

Is the host in your PHP code exactly varsports-api.aptulaff.workers.dev? And does a request from the same account to some other, unrelated HTTPS API resolve, or does every outbound request fail with error 6? That would show whether this is specific to workers.dev or to outbound requests from the account in general.

I couldn’t find any knowledge base article or staff answer that says how outbound DNS or outbound access from InfinityFree accounts works, so I can’t tell you whether this is a block, a fault or a problem in your code. Other people have posted the same “Could not resolve host” error for other sites, such as Discord’s API. The one solved topic I found was answered with a workaround, not an explanation: put a relay on another host that can reach the service, and have your site talk to the relay.

That topic is here, in case it’s useful:

It might be the same thing as yours, but nothing there confirms it. Your browser working doesn’t rule it out. The browser resolves the name from your own device, and PHP resolves it from the hosting server.

Checking DNS and outbound access on the server itself is something only a person on staff can do. If the answer to the other-API test is “everything fails”, that needs one of them to look at it.

@varsports_admin

Access to CloudFlare Workers on free hosting is blocked.