I\'m running PHP on a CentOS virtual machine under MacOS X, and any cURL request consistently takes 15s to run:
$c =
With PHP 7.1.32 installed with brew on macos, I got exactly this problem. file_get_contents and curl do not use the same DNS.
PHP 7.1.32
brew
file_get_contents
curl
Like @schumyxp said, you can resolve manually first:
BTW it's may be a good to force an IP instead of rely on a resolver.