2012-12-13 121 views
3

我在警告當我試圖通過我的在線服務器在我的Google日曆上同步約會。在Google日曆上同步約會時發出警告?

這裏是代碼行

public function addEvent($params) { 
     $url = "http://www.google.com/calendar/feeds/{$this->getFeedEmail()}/private/full"; 

     $xml = "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'> 
       <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> 
       <title type='text'>{$params['title']}</title> 
       <content type='text'>{$params['content']}</content> 
       <gd:when startTime='{$params["startTime"]}' endTime='{$params["endTime"]}'> 
       </gd:when> 
       <gd:transparency value='http://schemas.google.com/g/2005#event.transparent'> 
       </gd:transparency> 
       <gd:eventstatus value='http://schemas.google.com/g/2005#event.confirmed'> 
       </gd:eventstatus> 
       <gd:where valuestring='{$params['where']}'></gd:where> 

      </entry> 
       "; 
     $ret = $this->calPostRequest($url, $xml); 
     $matches = array(); 
     if(preg_match('/gsessionid=(.*?)\s+/', $ret, $matches)) { 
      $url .= "?gsessionid={$matches[1]}"; 
      $ret = $this->calPostRequest($url, $xml); 
     } 
     $retFields = explode("\n", $ret); 

     //ERROR HERE LINE 66 
     $entryXML = simplexml_load_string($retFields[count($retFields)-1]); //ERROR HERE 

     return array(
       "id"=> (string)$entryXML->id, 
       "etag"=> $this->getETagFromHeader($retFields), 
       "link"=> $this->getEditLinkFromHeader($retFields) 
       ); 
    } 

這裏警告:

Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/xxxxxx/public_html/wp-content/plugins/xxxxxxxxx-premium/menu-pages/google-cal-api/GoogleCalendar.php on line 115 
HTTP/1.1 201 Created Expires: Thu, 13 Dec 2012 08:00:49 GMT Date: Thu, 13 Dec 2012 08:00:49 GMT Set-Cookie: S=calendar=8Uizq1g9cPoo2XdIOGqjoQ;Expires=Fri, 21-Dec-2012 13:29:48 GMT Content-Type: application/atom+xml; charset=UTF-8; type=entry Cache-Control: private, max-age=0, must-revalidate, no-transform Vary: Accept, X-GData-Authorization, GData-Version GData-Version: 2.6 ETag: 「EU0MTwxFdyp7JGA6WhJa」 Location: http://www.google.com/calendar/feeds/andybartonpga%40gmail.com/private/full/03lq0bj7a93ck79e6meeq6263c Content-Location: http://www.google.com/calendar/feeds/andybartonpga%40gmail.com/private/full/03lq0bj7a93ck79e6meeq6263c X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Server: GSE Transfer-Encoding: chunked http://www.google.com/calendar/feeds/andybartonpga%40gmail.com/events/03lq0bj7a93ck79e6meeq6263c2012-12-13T08:00:48.000Z2012-12-13T08:00:49.000Z2012-12-13T08:00:49.000Zandy [email protected] 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, ‘<' not found in /home/xxx/public_html/wp-content/plugins/xxxxxxxxxxxxxxxxxx/menu-pages/google-cal-api/GoogleCalendar.php on line 66 

Warning: simplexml_load_string() [function.simplexml-load-string]: 1 in /home/xxxx/public_html/wp-content/plugins/xxxxxxx-premium/menu-pages/google-cal-api/GoogleCalendar.php on line 66 

Warning: simplexml_load_string() [function.simplexml-load-string]:^in /home/xxxxxxx/public_html/wp-content/plugins/xxxxxxxx-premium/menu-pages/google-cal-api/GoogleCalendar.php on line 66 

這裏卡: enter image description here

在服務器的php.inisafe_mode = offopen_basedir == xxx/xxx/xxx/xxx/xx

服務器沒有讓我改變:open_basedir == ""

我找到了解決方法,但無法理解,我應該把解決辦法代碼

鏈接1:here

Link2:here

Mates請幫我。 謝謝

+0

在我們可以幫助您弄清楚如何應用這些可能的解決方法之前,我們需要查看實際導致錯誤的代碼。 – Charles

+0

上面添加的代碼。 – Frank

回答

0

您是否嘗試過Link2中的解決方案?它看起來像它可能工作,如果你沒有修改php.ini的權限。

相關問題