【发布时间】:2010-01-25 12:07:41
【问题描述】:
Wordpress 正在http://myurl.com/feed/rss/ 处呈现 RSS 提要,但当然那里实际上并没有文件。我正在编写一个脚本来读取和呈现 RSS,但是将“文件”作为 XML 加载失败,因为那里实际上没有文件。我写:
$rss = simplexml_load_file('/news/feed/rss/');
我得到这个错误:
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "/news/feed/rss/"
即使使用 file_get_contents 也会给我这个错误:
警告:file_get_contents(/news/feed/rss/) [function.file-get-contents]:打开流失败:没有这样的文件或目录
【问题讨论】: