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!

 

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.