6

I have a local WordPress installation running at: https://catalogue3.test.

Note that all .test domains should resolve to localhost, as I use Laravel valet. When I execute the following code in my Laravel project however, I get an exception as shown below.

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', "https://catalogue3.test", ['verify' => false]);

ConnectException

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

When I run the command below in the terminal, the WordPress page is displayed.

curl https://catalogue3.test/ --insecure
7
  • Did you add catalogue3.test to your /etc/hosts file?
    – cmac
    Feb 13, 2019 at 8:02
  • Nop, Laravel valet use DnsMasq
    – Juliatzin
    Feb 13, 2019 at 8:20
  • Same issue here with a Laravel application running under Laravel Valet (no Wordpress). Have you find a fix ? Feb 14, 2019 at 10:03
  • @MaximeFreschard nop I didn't have any success :(
    – Juliatzin
    Feb 14, 2019 at 17:28
  • @MaximeFreschard Found a solution !
    – Juliatzin
    Feb 14, 2019 at 20:56

4 Answers 4

7

Add

ip catalogue3.test

to your /etc/hosts file

6

I tried to add the domain to hosts and I tried to change dns in network settings, this answer is what worked for me.

Quick way to check if this is your problem is to do: curl --version and php --ri curl

The versions should match. If they don't it's probably because brew has installed curl-openssl. This can be removed by doing:

brew uninstall curl-openssl --ignore-dependencies

Maybe there's a way to configure the installed curl-openssl properly - I've not investigated this yet.

2
  • I would have never figured this out. This worked though! Jan 2, 2020 at 21:58
  • Works like a charm. After runnig brew uninstall curl-openssl --ignore-dependencies you need to restart valet with valet restart.
    – codedge
    May 22, 2020 at 18:57
3

I solved this adding catalogue3.test to /etc/hosts, even if I was using DnsMasq, and in theory, I wouldn't need it.

3

In my case (on macos) I had to add 127.0.0.1 as the first DNS server option in my WiFi settings.

Some useful info here too: https://github.com/laravel/valet/issues/736

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.