WebAppsにインストールしたWordPressのGoogle XML Sitemapsでエラーが出た

AzureのWebAppsにWordPressをインストールし、設定のためにいくつかのプラグインを入れました。その中の「Google XML Sitemaps」というプラグインをインストールしたあとに設定を使用したところでエラーが発生しました。

The page cannot be displayed because an internal server error has occurred.

このエラーで検索すると、IISというMicrosoft製のWebサーバについてたくさんヒットしました。

内容からして、IISのエラーのようです。

このエラーの直し方はForumを参考にすると、wp-includes/SimplePie/Item.phpの127行目をコメントアウトすれば良いようです。

/**
* Remove items that link back to this before destroying this object
*/
public function __destruct()
{
    if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
    {
        unset($this->feed);
    }
}

これをこうします。

/**
* Remove items that link back to this before destroying this object
*/
public function __destruct()
{
    if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
    {
        // unset($this->feed);
    }
}

これで、正常に動くようになりました。