Closed 1stevengrant closed 1 year ago
Thanks @1stevengrant - I just ran across this too. Hope they fix it somehow! :-)
Thank you @1stevengrant !
@1stevengrant Can you let me know what error you're getting from Guzzle?
GuzzleHttp\Exception\ConnectException
cURL error 6: Could not resolve: craft3.test (Domain name not found) (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
@1stevengrant I did make some URL fixes in 1.0.5, so might be worth checking that out.
I assume craft3.test
is indeed the domain your site is running on?
yeah, updated to 1.0.5 but still the same on both issues.
@1stevengrant I've been talking briefly with @jalendport about this (the master of Valet), it seems like this is an issue with curl-openssl
for Valet.
Running the following seems to help:
brew uninstall curl-openssl --ignore-dependencies
brew services restart php@7.1
valet restart
To provide a little more context to Josh's comment:
I ran into this the other day with Andrew's Image Optimize plugin (it uses curl
to get the optimized image variants in the CP when you double-click on an asset). I traced the problem down to the curl-openssl
formula which is a dependency of all the PHP formulas you can install via Brew.
It seems curl-openssl
doesn't read the dnsmasq
config (dnsmasq
is what tells your computer that anytime you visit a .test
domain it should use your localhost instead of trying to run a dns query or ping a live serve; it is similar in idea to your /etc/hosts
file, but with /etc/hosts
you would have to add each .test
site, whereas dnsmasq is more of a wildcard solution), so it has no knowledge of your Valet domains. So when you remove curl-openssl
, PHP will fallback on your Mac's default install of curl
, which seems to read the dnsmasq
config just fine.
(Disclaimer: I can't say for certain that removing curl-openssl
won't do something "bad" in the long run, but I know that Valet and Craft seem to run fine without it. If worse were to ever come to worse, all you would ever have to do is just reinstall it and restart PHP/Valet.)
So I think short-term, adding them to the hosts file is fine. The only way I've found to "permanently" fix it for all your Valet sites is to uninstall curl-openssl
. Ideally someone finds a way to edit the curl
config or your php
config so that curl-openssl
functions the same as the default curl
.
You'll need to update
/etc/hosts
if using the plugin locally with Laravel Valeteg
127.0.0.1 craftsandbox.test
Else, Guzzle fails