オンラインサーバーを介して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 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
ここにスナップがあります:
php.ini のサーバーでsafe_mode = off
しかしopen_basedir == xxx/xxx/xxx/xxx/xx
サーバーは私が変更することを許可しませんでした: open_basedir == ""
回避策を見つけましたが、理解できません。回避策コードはどこに配置すればよいですか。
リンク1:ここ
Link2:こちら
仲間は私を助けてくれました。ありがとう