when I execute a PHP script which runs a cURL request to a .test domain that is setup on my Mac with Laravel Valet/dnsmasq, I get this error printed :
Could not resolve: mydomain.test (Domain name not found)
When I test the domain in my browser, it's OK.
When I run curl -Ik https://mydomain.test
in the Terminal, I get HTTP/2 200 code, so it's OK.
When I run curl -k https://mydomain.test
in the Terminal I get the source code of the page, so it's OK.
Why is it not working with cURL from PHP ? I'm desperate...
UPDATE
Due to popular demand ;-) here is my cURL code. You cannot do more simple :
try {
$ch = curl_init( "http://mydomain.test" );
curl_exec( $ch );
dump(curl_error($ch));
curl_close( $ch );
} catch (Exception $e) {
var_dump($e);
}