1
XAMPP 및 Windows에서 다음 기능을 사용하고 있습니다. 하지만 계속 "치명적인 오류 : 최대 실행 시간이 30 초를 초과했습니다"CURLOPT_TIMEOUT이 (가) php/windows에서 작동하지 않습니까?
팁이 있습니까?
function is_404($url) {
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($handle, CURLOPT_TIMEOUT,10);
curl_setopt($handle, CURLOPT_CONNECTTIMEOUT,10);
/* Get the HTML or whatever is linked in $url. */
$response = curl_exec($handle);
/* Check for 404 (file not found). */
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
/* If the document has loaded successfully without any redirection or error */
if ($httpCode >= 200 && $httpCode < 300) {
return false;
} else {
return true;
}
}
고마워요! 나는 한 번의 호출로 너무 많은 URL을 확인했기 때문에 PHP 시간 제한에 도달했습니다. 지금 0으로 설정하십시오. – giorgio79