curl - Some options not populated in php's curl_getinfo -


i'm seeing options not populated in return value of curl_getinfo, notably curlinfo_local_ip. here's code runs curl:

    $ch = curl_init("http://www.example.com/"); curl_setopt($ch, curlopt_header, 0); $m = fopen('php://memory', 'w+'); curl_setopt($ch, curlopt_stderr, $m); curl_setopt($ch, curlopt_returntransfer, true); curl_exec($ch); print_r(curl_getinfo($ch)); var_dump(curl_error($ch)); $p = ftell($m); $p += 1 << 20; rewind($m); $stderr = fread($m, $p); //var_dump($stderr); fclose($m); curl_close($ch); 

(there nothing of note in curl_error or stderr output)

here's curl_getinfo dump:

array (     [url] => http://www.example.com/     [content_type] => text/html     [http_code] => 200     [header_size] => 322     [request_size] => 54     [filetime] => -1     [ssl_verify_result] => 0     [redirect_count] => 0     [total_time] => 0.007369     [namelookup_time] => 0.004603     [connect_time] => 0.005864     [pretransfer_time] => 0.005921     [size_upload] => 0     [size_download] => 1270     [speed_download] => 172343     [speed_upload] => 0     [download_content_length] => 1270     [upload_content_length] => 0     [starttransfer_time] => 0.007324     [redirect_time] => 0     [redirect_url] =>     [primary_ip] => xx.xx.xx.xxx // omitted obvious reasons     [certinfo] => array         (         )  ) 

i'm able populate local_ip macro using curl directly so:

$ curl -w '%{local_ip}' 'www.example.com' ... xx.x.xxx.x // omitted, promise it's here 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -