2007/01/07

7

wordpress 2.0.6导致feedburner停工

skyreal , 04:34 pm / 950 pv / 分享到微博

feedburner wordpress rss feed xml php

[pic via]

在升级到wordpress 2.0.6之后,你的feedburner有可能会给出“invalid xml”(无效的xml)信息,并导致你的feed无法工作。
解决方法:
打开/wp-includes/functions.php 并查找如下代码:
if ( substr(php_sapi_name(), 0, 3) == ‘cgi’ )
@header("HTTP/1.1 $header $text");
else
@header("Status: $header $text");
}


把上面的代码替换成:

// if ( substr(php_sapi_name(), 0, 3) == ‘cgi’ )

@header("HTTP/1.1 $header $text");

// else

// @header("Status: $header $text");

}


另外一种简单的解决方法:
创建一个叫做FeedBurner.php的文件并加入如下代码:

$uri="http://neosmart.net/blog/feed/"; //Replace this URI with the URI to *your* feed!!

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $uri);

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

echo curl_exec($ch);

$status = curl_close($ch);

?>
然后去feedburnner把feed指向你刚创建的那个FeedBurner.php。



链接 | 来源

已有7条评论[ 上 ] [ 下 ]

  1. David Pan @ 2007-01-07 17:02:35 #1

    我的论坛没有发现这个问题。

    oo (0) / xx (0)
  2. skyreal @ 2007-01-07 17:12:37 #2

    呵呵,没有最好,小心为妙。

    oo (0) / xx (0)
  3. barry @ 2007-01-08 09:14:54 #3

    从一个开发wp的blog上看到的
    Note that this doesn’t prevent FeedBurner (or anyone else) from fetching your feed 100% of the time. The issue only arises with certain RSS consumers and only on certain servers, and only when the feed attempts to return a 304 Not Modified header. So with FeedBurner, for instance, one fetch attempt may trigger it, but the next will be fine.

    http://anonymouse.org/cgi-bin/anon-www.cgi/http://markjaquith.wordpress.com/2007/01/06/wordpress-206-feedburner-issue-and-fix/
    我好象也没有这个问题,但是还是下载了为秒(作者blog上提供了新的function页面)

    oo (0) / xx (0)
  4. maple @ 2007-01-09 23:19:54 #4

    我草!终于上来一次,留言纪念~~

    oo (0) / xx (0)
  5. sein @ 2007-01-09 23:23:17 #5

    哈哈,终于见到maple了~

    oo (0) / xx (0)
  6. jeamefuet @ 2010-04-03 13:35:23 #6

    Hiya People I am New, I have been browsing around this message board for about a few hours as a guest. I found it useful and it has helped me allot. I hope to hang around for abit and contribute.

    Cheers.

    oo (0) / xx (0)
  7. rilsGoose @ 2010-10-28 00:50:21 #7

    Hello!

    I’m new to this community and just thought it would be a good idea to introduce myself and say “hello”.

    Cheers!!!

    ~ Ruby

    oo (0) / xx (0)

填写称呼和邮箱即可发布评论[ 上 ] [ 优 ] [ IMG ]