Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2842
  • Last Modified:

PHP SimpleXML load file not working with URL source

I am trying to load an xml file from a remote URL.  The code below works just fine when I point to a local file.  However when I use a remote file I get the following error.  Is there some sort of encoding or datatype change I need to do when passing in a URL instead of a local file?


*****
simplexml_load_file(http://www.mcqnet.net/files/test.xml) [function.simplexml-load-file]: failed to open stream: No such file or directory
******
$xml = simplexml_load_file('http://www.mcqnet.net/files/test.xml');

Open in new window

0
billymcqueary
Asked:
billymcqueary
  • 2
  • 2
1 Solution
 
LordgobbledegookCommented:
You code exactly as above works fine at my end.  It appears that the problem does not lie with your code. I hope this helps somewhat.
0
 
billymcquearyAuthor Commented:
Lordgobble,
What version of PHP are you running?

0
 
LordgobbledegookCommented:
PHP 5.24

I am not sure off hand if it affects simplexml_load_file, but allow_url_fopen is On.
0
 
billymcquearyAuthor Commented:
I think I may have discovered the problem.  I will report back on that.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now