PHP - 解析大型XML URL

I got a problem to parse an xml URL. This xml is big, I wait in 2 minutes to load this xml URL. So when I parse it with the XMLReader or simpleXML_load_file, that reach the limit to excute. Everything is fine if I store the XML file in local, I can read it easily.

So any suggestion ? I read all the similar situation in stackoverflow but this case is diffrent.

Thanks.

You could try one or more of

  • increase the timeouts and possibly size restrictions on your local server or php instance
  • find a way to only download the new part of the xml and use that to update a local file containing the remainder of the data
  • download the entire file occasionally and use the cached copy