3

I'm running an XMLREADER to pull in various XML files and then parse it with SimpleXML in PHP5. This is working but for a particular file (around 4.5MB file size) it results in

Warning: XMLReader::open(http://www.blah.com/adm/feeds/The XML File.xml) [xmlreader.open]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /public_html/adm/cache/parsers/parser.php on line 15

But when I click ont the url listed the file is there. I've tested this on a similar dedicated server to mine and the problem doesn't happen.

Any ideas what might be going wrong? In summary the file is there but XMLREADER reports a 404 trying to open it.

hakre
  • 193,403
  • 52
  • 435
  • 836
bertster
  • 383
  • 1
  • 3
  • 17
  • Make sure www.blah.com resolves to the same IP address on your server as the one you get when accessing it from your browser. – halfer Mar 12 '12 at 22:04
  • Also, why are you using XMLReader _and_ SimpleXML? In general you only need to use one - the former is good for large documents, as it uses a forward-only file cursor through the XML, and SimpleXML is good for random access as it loads everything into memory. – halfer Mar 12 '12 at 22:06
  • Presumably the file parser.php is in itself being found? Make sure you can `echo` from this and get some output `:)` – halfer Mar 12 '12 at 22:07

1 Answers1

3

If this helps anyone - it was the filename that was the problem, it had a space in it which the host I'm on didn't like. Never had that problem on other hosts! Live an learn.

Brett

bertster
  • 383
  • 1
  • 3
  • 17