Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP呈现时未检测到RSS提要,但检测到呈现为静态XML文件_Php_Xml_Rss - Fatal编程技术网

使用PHP呈现时未检测到RSS提要,但检测到呈现为静态XML文件

使用PHP呈现时未检测到RSS提要,但检测到呈现为静态XML文件,php,xml,rss,Php,Xml,Rss,我使用数组中的一些数据生成了一个RSS提要,它验证并符合规范,但是当我从url这样的url用PHP呈现它并尝试在新闻阅读器中打开它时,阅读器告诉我没有提要。但是,如果我将其作为静态文件使用,它将加载。我错过了什么 进样 <?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>Exampel feed</title>

我使用数组中的一些数据生成了一个RSS提要,它验证并符合规范,但是当我从url这样的url用PHP呈现它并尝试在新闻阅读器中打开它时,阅读器告诉我没有提要。但是,如果我将其作为静态文件使用,它将加载。我错过了什么

进样

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>Exampel feed</title>
        <description>Example RSS Feed</description>
        <link>http://www.example.com</link>
        <subtitle>Test feed</subtitle>
        <item>
            <title>Equations</title>
            <link>http://example.com</link>
            <pubDate>Wed, 12 Oct 2015 08:00:00 EST</pubDate>
        </item>
    </channel>
</rss>

Exampel饲料
RSS提要示例
http://www.example.com
试验饲料
方程
http://example.com
2015年10月12日星期三美国东部时间08:00:00

我还更改了mime类型,
header(“内容类型:application/xml;charset=UTF-8”)

我正在feedreader.com中尝试这一点。您应该通过手动访问
/feed
,并将其与访问
/feed.xml
时发生的情况进行比较,来验证它是否确实是相同的输出。如果没有设置URL重写,
/feed.php
/feed
不同。