PHP Curl CURLOPT_IPRESOLVE

后端 未结 1 1619
忘掉有多难
忘掉有多难 2020-12-11 02:13

I have been working on a facebook application which uses facebook graph API for authentication, recently facebook upgraded to IPv6 and my network does\'nt support IPv6 so al

相关标签:
1条回答
  • 2020-12-11 02:34

    Check you curl version

    CURLOPT_IPRESOLVE is available since curl 7.10.8

    Try this sample code to test

    <?php
    
        $version = curl_version();
    
    // These are the bitfields that can be used 
    // to check for features in the curl build
    $bitfields = Array(
                'CURL_VERSION_IPV6', 
                'CURLOPT_IPRESOLVE'
                );
    
    
    foreach($bitfields as $feature)
    {
        echo $feature . ($version['features'] & constant($feature) ? ' matches' : ' does not match');
        echo PHP_EOL;
    }
    

    FYI: http://gcov.php.net/PHP_5_3/lcov_html/curl/interface.c.gcov.php

    0 讨论(0)
提交回复
热议问题