2017-09-20 4 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ドライブアプリを使用して、まさにこの問題を持っていた(マネージャAPI V2をタグ付けするための単純な呼び出し)

$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

時間が解決策を見つけようとした後、私はそれを得ました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

非常に良い!何時間もの検索とデバッグの後、私は根本的な原因を見つけました。そして、私は、Guulesソースを直接変更してtemp.txtファイルを使用しました。これは明らかにはるかに優れています。 – TheValyreanGroup

関連する問題