Is there any way to force cURL to use IPv4? I'm looking for like a global setting, like php.ini
setting or something like that.
Please try this code, with curl_setopt
This will force the IPV4 resolving.
if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
}
the defined insure that the global constants available on your PHP version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With