title: php cURL progress monitor?
body: <p>I'm using cURL in PHP to run a script that can take over an hour to run. For debugging purposes I'd like to be able to view the progress of the request by looking at the screen (this is not a public site) and see what's going on. I've tried a few things but am not having any luck. I don't need a lot of info, just something like 'now loading id 123'</p>
  
  <p>I've tried ob_flush, but apparently that is no longer supported as per: <a href="http://php.net/ob_flush" rel="nofollow">http://php.net/ob_flush</a></p>
  
  <p>I've also tried using <code>CURLOPT_PROGRESSFUNCTION</code> but there is not a lot of documentation on it and I couldn't get it to work. My code is very simple:</p>
  
  <pre><code>$sql = "select item_number from products order by id desc";
  $result_sql = $db-&gt;query($sql);
  while($row = $result_sql-&gt;fetch_assoc())
  {
  //I'd like it to display this as it loads
  print '&lt;br&gt;Getting data for item_number: '.$row['item_number']
  
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL,"http://targetsite.com//".$row['item_number']);
  curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($curl, CURLOPT_SSLVERSION, 3);
  //curl_setopt($curl, CURLOPT_HEADER, 1);
  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
  curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)");
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($curl, CURLOPT_VERBOSE, 1);
  }
  </code></pre>
  
  <p>Any advice? I'm really not fussy, just the easiest method that will quickly show me that something is happening.</p>