0
URL을 말아서 페이지 html을 얻는 PHP 스크립트를 작성했습니다. 페이지 내용은 약 50 % 정도 되돌아오고 나머지 부분은 내용의 일부만 반환되고 스크립트는 종료되지 않습니다. 내가 오류를받지 못했습니다 ... CLI에PHP Curl이 임의로 멈춤
$headers = array(
'Accept-Language: en-US,en;q=0.8',
'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36',
'Content-Type: application/x-www-form-urlencoded',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.youtube.com/channel/UCkN6ktadXpZl_viwRCSEGUQ');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$curl_info = curl_getinfo($ch);
$response = curl_exec($ch);
curl_close($ch);
print $response;
print_r($curl_info);
실행 :
php script_name.php
하면 10 배를 실행하거나 그래서 당신은 더 적어도 몇 번을 완료 할 수없는 것을 볼 수 있습니다 경고 또는 오류 ...
Windows 또는 Linux에서 이것을 실행하고 있습니까? – mishu
Windows에서 페이지를 다운로드하는 데 걸리는 시간이 실행 시간으로 간주되므로 http://php.net/set_time_limit을 참조하십시오. – mishu
우분투 그놈 14.04 – user3331119