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.

3
  • 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. Commented Mar 12, 2012 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. Commented Mar 12, 2012 at 22:06
  • Presumably the file parser.php is in itself being found? Make sure you can echo from this and get some output :) Commented Mar 12, 2012 at 22:07

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.