PHP에서 cURL을 사용하여 한 시간 이상 소요될 수있는 스크립트를 실행하고 있습니다. 디버깅 목적으로 화면을 보면서 요청 진행 상황을 볼 수 있기를 원합니다.이 작업은 공개 사이트가 아니며 진행 상황을 확인하는 것입니다. 나는 몇 가지 시도했지만 행운이 없다. 나는 정보의 많은, 내가 ob_flush 시도했습니다php cURL 진행 모니터?
'이제 ID (123)를로드'와 같은 뭔가가 필요하지 않지만, 당 분명히 그것은 더 이상 지원되지 : 나는 또한 사용하려고했습니다 http://php.net/ob_flush
CURLOPT_PROGRESSFUNCTION
하지만 거기에는 많은 문서가 없으므로 제대로 작동하지 않습니다. 내 코드는 매우 간단합니다 :
$sql = "select item_number from products order by id desc";
$result_sql = $db->query($sql);
while($row = $result_sql->fetch_assoc())
{
//I'd like it to display this as it loads
print '<br>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);
}
어떤 조언이 있습니까? 나는 정말 까다 롭지 않아, 뭔가 일이 일어나고 있다는 것을 빨리 알 수있는 가장 쉬운 방법 일뿐입니다.
를 사용하는 PHP 버전? – brandonscript
from php info() : PHP 버전 5.3.24 – user2029890