{"id":7142,"date":"2014-05-25T22:51:16","date_gmt":"2014-05-25T22:51:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/25\/google-calendar-api-v3-login-collection-of-common-programming-errors\/"},"modified":"2014-05-25T22:51:16","modified_gmt":"2014-05-25T22:51:16","slug":"google-calendar-api-v3-login-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/25\/google-calendar-api-v3-login-collection-of-common-programming-errors\/","title":{"rendered":"Google Calendar API v3 Login-Collection of common programming errors"},"content":{"rendered":"<p>i&#8217;m using the google calendar api v3 to sync my websites data. yesterday it just worked fine, but today it doesn&#8217;t work at all and i can&#8217;t &#8220;login&#8221; again.<\/p>\n<p>the permission request is here: https:\/\/accounts.google.com\/o\/oauth2\/auth?response_type=code&amp;redirect_uri=http%3A%2F%2Fwww.studybuddy.at%2FgoogleCalendar.php&amp;client_id=1097350011472.apps.googleusercontent.com&amp;scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&amp;access_type=offline&amp;approval_prompt=force<\/p>\n<p>this calls then this page: http:\/\/www.studybuddy.at\/googleCalendar.php<\/p>\n<p>you can see the code here (googleCalendar.php)<\/p>\n<pre><code>echo \"client \";\nsession_start();\n\nrequire_once \"googleAPI\/apiClient.php\";\nrequire_once \"googleAPI\/contrib\/apiCalendarService.php\";\n\n\n$apiClient = new apiClient();\n$apiClient-&gt;setUseObjects(true);\n$service = new apiCalendarService($apiClient);\n\n\nif ($_SESSION['oauth_access_token']!=\"\") {\n\n $apiClient-&gt;setAccessToken($_SESSION['oauth_access_token']);\n\n\n\n\n} else {\n\n  $token = $apiClient-&gt;authenticate();\n  $_SESSION['oauth_access_token'] = $token;\n\n\n}\n<\/code><\/pre>\n<p>i&#8217;m getting crazy. please help me&#8230;whats the problem? wenn i click on authorize it gets just stuck<\/p>\n<p>UPDATE: error log<\/p>\n<p>Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(\/tmp\/apiClient\/ad\/ad41610b13f338f946b8e9e744ec68f0.lock) is not within the allowed path(s): (\/home\/.sites\/149\/site1825\/web:\/home\/.sites\/149\/site1825\/tmp:\/usr\/share\/pear) in \/home\/.sites\/149\/site1825\/web\/googleAPI\/cache\/apiFileCache.php on line 37<\/p>\n<p>Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(\/tmp\/apiClient\/ad\/ad41610b13f338f946b8e9e744ec68f0) is not within the allowed path(s): (\/home\/.sites\/149\/site1825\/web:\/home\/.sites\/149\/site1825\/tmp:\/usr\/share\/pear) in \/home\/.sites\/149\/site1825\/web\/googleAPI\/cache\/apiFileCache.php on line 96<\/p>\n<p>Fatal error: Uncaught exception &#8216;apiIOException&#8217; with message &#8216;HTTP Error: (0) Failed to connect to 2a00:1450:4001:c01::54: Network is unreachable&#8217; in \/home\/.sites\/149\/site1825\/web\/googleAPI\/io\/apiCurlIO.php:128 Stack trace: #0 \/home\/.sites\/149\/site1825\/web\/googleAPI\/auth\/apiOAuth2.php(96): apiCurlIO-&gt;makeRequest(Object(apiHttpRequest)) #1 \/home\/.sites\/149\/site1825\/web\/googleAPI\/apiClient.php(131): apiOAuth2-&gt;authenticate(Array) #2 \/home\/.sites\/149\/site1825\/web\/googleCalendar.php(21): apiClient-&gt;authenticate() #3 {main} thrown in \/home\/.sites\/149\/site1825\/web\/googleAPI\/io\/apiCurlIO.php on line 128<\/p>\n","protected":false},"excerpt":{"rendered":"<p>i&#8217;m using the google calendar api v3 to sync my websites data. yesterday it just worked fine, but today it doesn&#8217;t work at all and i can&#8217;t &#8220;login&#8221; again. the permission request is here: https:\/\/accounts.google.com\/o\/oauth2\/auth?response_type=code&amp;redirect_uri=http%3A%2F%2Fwww.studybuddy.at%2FgoogleCalendar.php&amp;client_id=1097350011472.apps.googleusercontent.com&amp;scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&amp;access_type=offline&amp;approval_prompt=force this calls then this page: http:\/\/www.studybuddy.at\/googleCalendar.php you can see the code here (googleCalendar.php) echo &#8220;client &#8220;; session_start(); require_once &#8220;googleAPI\/apiClient.php&#8221;; require_once [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7142","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7142"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7142\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}