URL file-access is disabled in the server configur


I have the following line of code:


causing the following warning:

Warning: DOMDocument::loadHTMLFile() [function.DOMDocument-loadHTMLFile]: URL file-access is disabled in the server configuration in /home/.obsididan/munnelly/arcticassassins.com/orlandoscrape.php on line 22

From what I understand it is common for hosting companies to block URL file-access. Is there an easy way around this?



The standard fix for this sort of trouble is to use cURL to download the target page rather than using allow_url_fopen. General instructions for how to do this can be found on the wiki. cURL will load the target page into a string which you can then parse using $dom->loadHTML($curl_result);


Wow, that was quick! Thanks for the help, I’ll give it a try.