Jump to content

simplexml_load_file (script url) failed to open stream...


gptimajo

Recommended Posts

Hi Guys!

 

I'm new here at PHPFreaks, I have this problem using simplexml_load_file function.

 

I am retrieving an XML from another sub-domain of my project, it's working fine on my local server (win xp, php 5.2.14) but when I try to execute it on our testing server (linux, php 5.2.14) it returns an error something like this..

 

Warning: simplexml_load_file() [function.simplexml-load-file]: failed to open stream: Connection timed out in [absolute path of the script] on line 3

 

i have tried cURL and file_get_contents, still get no luck.

 

please note that the XML is validated via w3c.org and works really fine on my local server..

 

Thanks in advanced!

 

did you try simplexml_load_string like below when you used file_get_contents...

$path = "http://sub.domain.tld/simple.xml"; //sub your actual path
$data = file_get_contents($path);
# print_r($data); // See what was loaded...

$xml = simplexml_load_string($data);

did you try simplexml_load_string like below when you used file_get_contents...

$path = "http://sub.domain.tld/simple.xml"; //sub your actual path
$data = file_get_contents($path);
# print_r($data); // See what was loaded...

$xml = simplexml_load_string($data);

 

i haven't tried simplexml_load_string but what i can tell you is file_get_contents also fails..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.