0
google-api-php-clientライブラリでOAuth2サービスをテストして、ログインしたユーザーのGoogleアカウントでUserInfoにアクセスしています。コードはexamples/userinfo/index.phpから取得され、私のホストに対処するための変更はほとんどありません。この例を実行すると、Googleログインフォームを通過しました。それが私のサイトに戻ったとき、次のようにスローされた例外。google-api-php-clientライブラリでUserInfoサービスで認証できません
Fatal error: Uncaught exception 'apiIOException' with message 'HTTP Error: (0) couldn't connect to host' in /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiCurlIO.php:120
Stack trace:
#0 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiCurlIO.php(46): apiCurlIO->makeRequest(Object(apiHttpRequest))
#1 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiREST.php(55): apiCurlIO->authenticatedRequest(Object(apiHttpRequest))
#2 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/service/apiServiceResource.php(151): apiREST::execute(Object(apiServiceRequest))
#3 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/contrib/apiPlusService.php(207): apiServiceResource->__call('get', Array)
#4 /home/ztbmwjhd/public_html/apis/at/googleplus/google-plus-access.php(40): PeopleServiceResource->get('me')
#5 /home/ztbmwjhd/public_html/apis/at/googleplus/index.php(2): include_once('/home/ztbmwjhd/...')
#6 {main}
throw in /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiCurlIO.php on line 120
あなたの助け
ありがとうChirag、私はプロキシを使用しません。 「curl https://www.googleapis.com/oauth2/v1/userinfo?access_token=」が機能していないようです –
どのようなエラーが表示されますか?あなたはもっと冗長なロギングのために "curl -v URL"を試すことができますか? –