1
I receive an XML via a feed URL with extension .RSS. I am trying to read the XML and was not successful. I tried it in the following ways:
$url = 'http://www.feedaqui.com.br/recent.rss';
$xml = simplexml_load_file($url);
$url = 'http://www.feedaqui.com.br/recent.rss';
$xml = simplexml_load_string(file_get_contents($url));
Generating the error:
Warning: simplexml_load_file(): I/O warning : failed to load external entity
What mistake it makes?
– Rodrigo Rigotti
I edited and added the bug.
– Marcelo de Andrade
In your php.ini, change the allow_url_fopen setting to on or use Curl.
– gmsantos
I used Curl and gist 5405671 tip from betweenbrain https://gist.github.com/betweenbrain/5405671
– Marcelo de Andrade
If it works, add a reply and validate after two days.
– Rodrigo Rigotti
The extension in the file/url nomenclature does not influence anything. The important thing is the content-type and the content itself. For example, the URL can be http://.../feed.exe and if the . exe returns a content-type text type, then it will be treated as text.
– Daniel Omine