Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

eriktobben's avatar

Valet: cURL error 6: Could not resolve

Hi,

I am trying to access another project (API) via one of my projects locally. This has worked before, but now I get the following error:

cURL error 6: Could not resolve: scheduler.test (Domain name not found) (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

In .env the url is http://scheduler.test/api

I am able to access the site in Safari, but I get the Guzzle error when trying to access it via the other project.

I have tried restarting Valet, but that did not work.

Any suggestions? :)

0 likes
3 replies
cre-mer's avatar

Try adding 127.0.0.1 to your DNS-Server list in the network settings. I had the same problem. When using curl my-domain.test in the terminal it worked just fine. But PHP's cURL didn't find the page. So as mentioned, adding 127.0.0.1 to your DNS-Server list should solve the problem :)

2 likes
repat's avatar

Thanks @cre-mer, that did the trick! However, you need to move 127.0.01 (or ::1 for that matter) up as the first address to check. I didn't work for me when e.g. Googles (8.8.8.8) was first.

1 like

Please or to participate in this conversation.