# PHP cURL error 6 connecting to Cloudflare Workers

**URL:** <https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146>\
**Category:** Hosting Support\
**Created:** [October 7, 2026, 10:18pm UTC](https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146 "2026-10-07T22:18:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![varsports\_admin](https://forum.infinityfree.com/letter_avatar/varsports_admin/32/6_449c533f586939b6e5f246632a46421f.png) [@varsports\_admin](https://forum.infinityfree.com/u/varsports_admin)\
**Post date:** [October 7, 2026, 10:18pm UTC](https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146/1 "2026-10-07T22:18:40Z")

</div>

### Website URL

[https://varsports.gt.tc](https://varsports.gt.tc)

### Error Message

The endpoint [https://varsports-api.aptulaff.workers.dev/health](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](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.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 7, 2026, 10:18pm UTC](https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146/2 "2026-10-07T22:18:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lemni](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lemni/32/68303_2.png) [@Lemni](https://forum.infinityfree.com/u/Lemni)\
**Post date:** [October 7, 2026, 10:19pm UTC](https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146/3 "2026-10-07T22:19:00Z")

</div>

_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:

> [@cURL Error: Could not resolve host: discord.com](https://forum.infinityfree.com/t/curl-error-could-not-resolve-host-discord-com/116685):
>
> Hi, I am trying to use oauth on my site with discord for logging in and registering but I get the cURL error cURL Error: Could not resolve host: [discord.com](http://discord.com) I have made requests to other oauth but it can’t resolve discord, can you please allow it/explain why it might be being blocked?

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.

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [October 8, 2026, 5:14am UTC](https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146/4 "2026-10-08T05:14:50Z")

</div>

@varsports_admin

Access to CloudFlare Workers on free hosting is blocked.

> [@Outbound DNS problem](https://forum.infinityfree.com/t/outbound-dns-problem/120368/5):
>
> I have received a definitive answer from [iFastNet](https://www.infinityfree.com/go/ifastnet) about this issue. And I’m sorry to say: this is an intentional block, and it will not be lifted. I’m not sure what you’re doing on Cloudflare Workers, but [another person reporting this issue](https://forum.infinityfree.com/t/outside-sites-dns-could-not-resolve/120395) stated it was to be able to access Telegram’s APIs, which we have blocked deliberately. And that’s precisely the reason we’re blocking access to Cloudflare’s workers now: it’s primarily being used to bypass the Telegram API stuff to send spam and for other …

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 15, 2026, 5:15am UTC](https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146/5 "2026-10-15T05:15:31Z")

</div>

Closed on October 15, 2026, 5:15am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
