Stop simplexml_load_file() 500 Errors in PHP

If you find that you are receiving 500 errors with simplexml_load_file() but you can access the xml/rss feed manually through a browser, your script is probably being blocked by a user agent sniffer.

Add this code before your xml call to remedy this issue:

ini_set("user_agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
ini_set("max_execution_time", 0);
ini_set("memory_limit", "10000M");

Copied from: http://www.php.net/manual/en/function.simplexml-load-file.php#102974

Tags: , , ,

About Keiron

Web Developer based in the UK. Click here if you want to work with me