Couldn't resolve host

Couldn't resolve host

QA

Couldn't resolve host

답변 2

본문

안녕하세요.

 

curl 로 api 긁어오는데

 

갑자기 되지않아 curl 에러를 확인해보니 Couldn't resolve host 해당 에러를 맽어내더군요.

 

Couldn't resolve host 'oapi.ecounterp.com' 
 

resolv.conf 쪽에 네임서버도 정상적으로 입력되어있고

 

소스 문제인가 싶어 

 

다른 서버에서 테스트하니 정상적으로 받아오고 있습니다..

<?php

function get_ecount_data($url,$json_data){//json parse

  $ch = curl_init($url);

  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

  curl_setopt($ch, CURLOPT_URL, $url);

  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

  curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);

  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

  curl_setopt($ch, CURLOPT_POST, true);

  $output = curl_exec($ch);

  if (curl_error($ch)) {

      $error_msg = curl_error($ch);

    print_r($error_msg);

  }

  curl_close ($ch);

  return $output;

}

?>

서버쪽 설정을 봐야할꺼같은데 서버쪽은 많이 부족해서 어느부분을 봐야하는지

고수님들 도움부탁드립니다~ 감사합니다.

 

 

이 질문에 댓글 쓰기 :

답변 2

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 1
© SIRSOFT
현재 페이지 제일 처음으로