# PHP cURL error 6 when connecting to my Cloudflare Worker

**URL:** <https://forum.infinityfree.com/t/php-curl-error-6-when-connecting-to-my-cloudflare-worker/121377>\
**Category:** Hosting Support\
**Created:** [October 16, 2026, 6:55pm UTC](https://forum.infinityfree.com/t/php-curl-error-6-when-connecting-to-my-cloudflare-worker/121377 "2026-10-16T18:55:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 16, 2026, 6:55pm UTC](https://forum.infinityfree.com/t/php-curl-error-6-when-connecting-to-my-cloudflare-worker/121377/3 "2026-10-16T18:55:40Z")

</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._

Your hosting account can’t reach `workers.dev` hostnames. It’s an intentional block, so it isn’t a DNS resolver fault on your server, and nothing on your side will fix it.

A staff answer in another topic, about the same “could not resolve host” error on a `workers.dev` address, says the block was confirmed with [iFastNet](https://www.infinityfree.com/go/ifastnet), our hosting provider. It says the block won’t be lifted. The reason given is that Cloudflare Workers were mostly being used to get around the block on Telegram’s APIs, to send spam and for other abuse. Staff acknowledged that this also hits legitimate uses.

Here’s that answer:

> [@Outbound DNS problem](https://forum.infinityfree.com/t/outbound-dns-problem/120368):
>
> Website URL [https://saxeknife.ryex.uk/](https://saxeknife.ryex.uk/)Error Message Outbound curl from my site suddenly fails with “Could not resolve host: saxeknifediscord.95-rui-silva.workers.dev”. Other Information (Cloudflare Worker). It worked until ~24h ago, no config changes. Can you check outbound DNS on my account’s server?

Another user hit the same error on a `workers.dev` address on Oct 7, 2026:

> [@PHP cURL error 6 connecting to Cloudflare Workers](https://forum.infinityfree.com/t/php-curl-error-6-connecting-to-cloudflare-workers/121146):
>
> 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 …

The Worker works in your browser because the block only applies to outgoing connections from the hosting servers.

I didn’t find anything saying a Worker on a custom domain would get around the block, so I can’t tell you whether it would.

---

_[View the full topic](https://forum.infinityfree.com/t/php-curl-error-6-when-connecting-to-my-cloudflare-worker/121377)._
