cURL on local WordPress site returns: Error 6 (Could not resolve host) cURL on local WordPress site returns: Error 6 (Could not resolve host) wordpress wordpress

cURL on local WordPress site returns: Error 6 (Could not resolve host)


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.


Add

ip catalogue3.test

to your /etc/hosts file


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