I have 2 IP address on my dedicated server
- ipv4
- ipv6
i m trying to use ipv6 on CURL, below are code using on curl.
curl_setopt($ch, CURL_IPRESOLVE, CURL_IPRESOLVE_V4);
or
curl_setopt($ch, CURL_IPRESOLVE_V4, true);
but i got below error
Notice: Use of undefined constant CURL_IPRESOLVE - assumed 'CURL_IPRESOLVE' in /home/admin....... line 14
you have to use CURL_IPRESOLVE_WHATEVER
for both IP versions
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER);
More information refere this DOC
To use specifically IPv4, use
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
Official doc here: http://php.net/manual/en/function.curl-setopt.php