3

当我尝试通过我的在线服务器在我的谷歌日历上同步约会时收到警告。

这是代码行

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 bartonandybartonpga@gmail.com

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, ‘&lt;' 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

这里是快照: 在此处输入图像描述

php.ini safe_mode = off中的服务器但是open_basedir == xxx/xxx/xxx/xxx/xx

服务器不允许我更改: open_basedir == ""

我找到了解决方法但无法理解,我在哪里放置解决方法代码

链接1:这里

链接2:这里

请大佬帮帮我。谢谢

4

1 回答 1

0

您是否尝试过 Link2 中的解决方案?如果您没有修改 php.ini 的权限,它看起来可能会起作用。

于 2013-07-02T18:48:23.480 回答