2017-09-20 1 views
2

Google App Engine에서 호스팅되고 로컬 개발을 위해 app_devserver를 사용하는 프로젝트에서 작업하고 있습니다. 처음에는 인증서에 문제가 있었지만 마침내 그 오류를 극복 한 후에이 새로운 오류가 발생했습니다URL 오류 0 : cURL 요청이 3 번 시도되고 성공하지 못했습니다.

Windows 10 및 PHPstorm을 개발 용으로 사용하고 있습니다.

오류 :

이 오류는 요청이와 성공적인하지만 몸이 해결되거나 해석 할 수 없었던 것이 말처럼

Message: cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

가 같은데? 어떻게 해결할 수 있습니까? 필요한 경우

내 PHP 코드입니다 : 시간이 해결책을 찾기 위해 노력 후, 나는 Google 드라이브 앱 사용하여 정확히 문제가 있었다

$client = new Google_Client(); 
    $client->setAuthConfig('service_account.json'); 

    $client->setApplicationName("gtmdocx"); 
    /*$client->setScopes(['https://www.googleapis.com/auth/tagmanager.readonly', 
         'https://www.googleapis.com/auth/tagmanager.manage.accounts', 
         'https://www.googleapis.com/auth/tagmanager.edit.containers']);*/ 
    $client->setScopes(['https://www.googleapis.com/auth/tagmanager.readonly']); 
    $service = new Google_Service_TagManager($client); 
    $results = $service->accounts->listAccounts(); 


    echo $_GET['callback'] . '('.json_encode($results).')'; 
+0

이것을 알아 냈습니까? Google api에서도 동일한 문제가 발생합니다. – TheValyreanGroup

+0

@ TheValyreanGroup 어떤 운영 체제와 IDE를 사용하고 있습니까? – Asim

+0

Windows 및 아무 ide. – TheValyreanGroup

답변

2

(단순 호출 관리자 API v2가 태그), 알았어 GuzzleHttp 싱크 옵션을 사용하여 작업 할 수 있습니다.

$client = new \Google_Client(); 
// ... Client Configuration 

$httpClient = new Client([ 
    'sink' => 'path_to_any_temp_file', 
    'base_uri' => $client->getConfig('base_path'), 
]); 
$client->setHttpClient($httpClient); 

가치가 있습니다.

+0

아주 좋습니다! 몇 시간 동안 검색하고 디버깅 한 후, 근본 원인을 발견했으며 I Gu는 guules 소스를 직접 수정하여 temp.txt 파일을 사용했습니다. 이것은 분명히 훨씬 낫다. – TheValyreanGroup