在php中加载xml文件-缺少访问权限?

在php中加载xml文件-缺少访问权限?,php,xml,access-rights,Php,Xml,Access Rights,我想用以下代码从某个链接读取XML文件 $filename = 'http://XXXXX/rss.xml'; $xml = simplexml_load_file($filename); 当我尝试时,会收到以下错误消息: wrapper is disabled in the server configuration by allow_url_fopen=0 failed to open stream: no suitable wrapper could be found in I/

我想用以下代码从某个链接读取XML文件

$filename = 'http://XXXXX/rss.xml';
$xml = simplexml_load_file($filename);
当我尝试时,会收到以下错误消息:

 wrapper is disabled in the server configuration by allow_url_fopen=0 

failed to open stream: no suitable wrapper could be found in 

I/O warning : failed to load external entity 

有什么问题吗?服务器是否不支持simplexml加载文件?

允许url\u fopen
设置为
0
时,您无权访问文件等url对象。阅读了解更多信息


无法通过.htaccess更改此值,因此必须在
php.ini
文件中设置
allow\u url\u fopen=1
。如果您使用的是共享主机或某种类型的主机,您应该联系主机技术支持,并向他们描述您的问题。

allow\u url\u fopen=0
就是问题所在。将其设置为true/1以允许此操作,或者尝试先下载文件。好的,我刚刚看到我无法使用我的提供商将其设置为true。谢谢你的帮助