3

Am getting warning when am trying to sync appointment on my Google Calendar via my online server.

Here is code Lines

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)
                );
    }

Here is warning:

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, ‘<' 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

Here the snap: enter image description here

At server in php.ini safe_mode = off But open_basedir == xxx/xxx/xxx/xxx/xx

Server not allowed me to change: open_basedir == ""

I Found a workaround but unable to understand, where do i put workaround code

Link1: here

Link2: here

Mates helped me please. Thanks

Frank
  • 2,285
  • 7
  • 43
  • 68
  • We need to see the code that's actually causing the error before we can help you figure out how to apply those possible workarounds. – Charles Dec 13 '12 at 08:52

1 Answers1

0

Have you tried the solution in Link2? It looks like it might work if you don't have permission to modify the php.ini.

Marc Seiler
  • 494
  • 4
  • 15