0

I'm having a timeout when trying to open an external XML (which exists, I can see it in the browser when placing the direct link).

I am sure XMLReader is installed and on, and it works if calling a local XML (tested and works as expected).

But when trying to get the same XML from an external source (another domain) I get this (domains and IPs masked here):

[Mon May 12 20:03:44 2014] [error] [client xxxxxx] PHP Warning:  XMLReader::open(http://myotherdomain/data.xml): failed to open stream: Connection timed out in /var/www/html/mysite/xmlreader.php on line 29
[Mon May 12 20:03:44 2014] [error] [client xxxxxx] PHP Warning:  XMLReader::open(): Unable to open source data in /var/www/html/mysite/xmlreader.php on line 29

Line 29 refers to the open():

if (!$reader->open("http://myotherdomain/data.xml"))

My server is a CentOS 6.5, Apache 2.2.15, PHP 5.4.25

What is wrong here?, why am I getting a timeout? (this happens with every external XML that I have tried)

2
  • 1
    can you try to SSH into servers and issue wget or curl to download file? Just to test connectivity. Other than that, this is too "XMLReader" specific, as we have no idea what open() really does (does it use curl, fsockopen, file_get_contents or something else to fetch the XML?)
    – ek9
    May 12, 2014 at 20:08
  • @edvinas.me thanks for the suggestions, it helped me pin point the problem, it was related to the firewall after all.
    – jackJoe
    May 13, 2014 at 10:25

1 Answer 1

1

I found the problem, it was related to the firewall port 80…

It didn't allow connections from the server to the exterior, so not related to XMLReader after all, and another firewall related issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .