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)
wget
orcurl
to download file? Just to test connectivity. Other than that, this is too "XMLReader" specific, as we have no idea whatopen()
really does (does it use curl, fsockopen, file_get_contents or something else to fetch the XML?)