curl로 작업할때 Operation timed out after 20001 milliseconds with 0 out of 0 bytes received 오류 메시지 나올때 해결 방법
·
조회수 12
api 데이터를 curl로 받아올때 Operation timed out after 20001 milliseconds with 0 out of 0 bytes received 오류 메시지 나올때 해결 방법입니다.
1.기본 20초를 아래와 같이 60초로 늘려주기
curl_setopt($ch, CURLOPT_TIMEOUT, 60); // 60초까지 대기
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // 연결 시도는 10초
2.api에서 정의한 한번에 요청할 수 있는 최대갯수보다 적게 지정을 해주기