Reputation: 4179
I am using PHP XML DOM to read the content of RSS Feed. It works fine in my local server, but the hosting server it gives error like below
Warning: DOMDocument::load() [(B)domdocument.load]: URL file-access is disabled in the server configuration in ....
After searching for that issue I found that the hosting server normally disabled that feature file_access. What is the alternate method to read RSS content without changing the server configuration.
Here is my code snippet.
function readRSS ($rssURL, $entryno)
{
//$xml ="http://feeds.feedburner.com/OnlyMyHealth-Diabetes";
$xmlDoc = new DOMDocument();
$xmlDoc->load($rssURL);
}
Upvotes: 1
Views: 376
Reputation: 20475
You can use cURL, which is very powerful, and will probably be enabled (altho you can always test on your host)
One tutorial here: http://ditio.net/2008/06/19/using-php-curl-to-read-rss-feed-xml/
But basically you do something similar to your DOMDocument()
approach but with cURL.
UPDATE
You could also just cURL the RSS feed to a local folder, and use DOMDocument on the local file as it sounds like its only URL disabled (remote files). Local might work just fine.
Upvotes: 1