Warning: Undefined array key "mobile_dir" in /home/kagla/new-sir/old/common.php on line 315
네이버로그인 관련 Couldn't resolve host 'nid.naver.com' 에러출력 관련사항 ㅠㅠㅠㅠ

네이버로그인 관련 Couldn't resolve host 'nid.naver.com' 에러출력 관련사항 ㅠㅠㅠㅠ

네이버로그인 관련 Couldn't resolve host 'nid.naver.com' 에러출력 관련사항 ㅠㅠㅠㅠ

QA

네이버로그인 관련 Couldn't resolve host 'nid.naver.com' 에러출력 관련사항 ㅠㅠㅠㅠ

답변 1

본문

안녕하세요...

sns로그인 플러그인 사용하여 네이버로그인 작업 진행중입니다.

토큰값을 받아오는 과정에서


function get_access_token($code)
    {
        $url = $this->token_url.'?client_id='.$this->client_id.'&client_secret='.$this->secret_key.'&grant_type=authorization_code&state='.$this->token.'&code='.$code;
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
    
    
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        $json = curl_exec($ch);
        $err = curl_error($ch); 
        echo $err; 
        exit;
        curl_close($ch);
        
        if($json) {
            $result = json_decode($json);
            $this->access_token  = $result->access_token;
            $this->refresh_token = $result->refresh_token;
            return true;
        } else {
            return false;
        }
    }

이 부분 소스의


        $json = curl_exec($ch);
        $print_r($json);
        curl_close($ch);

print_r($json)시 아무것도 출력이 되지 않습니다.

그래서 에러메시지 출력하는 코드를 작성해서 테스트를 진행하였는데

 

 > Couldn't resolve host 'nid.naver.com'

이런오류가 출력되던대 혹시... 뭐가 문제일까요...ㅠㅠㅠ

 

 

이 질문에 댓글 쓰기 :

답변 1

http://kb.globalsoft.co.kr/web/web_view.php?notice_no=106

참고 내용 확인해 보세요

정확한 경로로 호스트를 인식 못해서 발생되는 오류로 확인 됩니다.

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